-
|
として生成したコードをビルドしたところ、こんなエラーが出ました。 実際、コードを見たところこんなコードが生成されていました。 じゃあdocsでどう定義されているかと見ると、 となっています。試しにファイル保存したdocsの上記3つを 手元で書き換えれば良いことではありますが、mirakc側での対応でそのまま生成出来るコードになったりしますか? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 6 replies
-
|
表現は変わってしまいますが, {
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"recording"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"finished"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"canceled"
]
}
}
},
{
"type": "object",
"required": [
"reason",
"type"
],
"properties": {
"reason": {
"$ref": "#/components/schemas/RecordingFailedReason"
},
"type": {
"type": "string",
"enum": [
"failed"
]
}
}
}
],
"title": "RecordingStatus",
"description": "A recording status."
}修正箇所は以下のみです. --- a/mirakc-core/src/recording.rs
+++ b/mirakc-core/src/recording.rs
@@ -2528,7 +2528,7 @@ impl Record {
/// A recording status.
#[derive(Clone, Debug, Deserialize, Serialize)]
-#[serde(rename_all = "camelCase")]
+#[serde(rename_all = "camelCase", tag = "type")]
#[derive(ToSchema)]
#[schema(title = "RecordingStatus")]
pub enum RecordingStatus {これでよければ,上記修正を |
Beta Was this translation helpful? Give feedback.
-
|
生成コードを見ると, 生成ツールにも問題があるみたいですね. |
Beta Was this translation helpful? Give feedback.
-
|
なるほど・・・なかなか難しいですね |
Beta Was this translation helpful? Give feedback.
-
|
型自体を変換しないと無理っぽいので,変更してみました. 多分これなら自動生成できると思います. 他にも自動生成できないモデルがあればまとめて修正してしまうので,そういうのが見つかったらコメントをください. |
Beta Was this translation helpful? Give feedback.
-
|
自動生成されたコードでビルド出来ないのは上記のRecordingStatusだけだったので、変更後も自動生成出来るようであれば大丈夫だと思います。 自動生成するときに |
Beta Was this translation helpful? Give feedback.
-
|
どうも "license": {
"name": "MIT OR Apache-2.0"
},確認してみます. |
Beta Was this translation helpful? Give feedback.
-
|
openapiの仕様上は
ここで
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
#2121 を |
Beta Was this translation helpful? Give feedback.
-
|
確認遅れましたが3.3.0で生成したコードがそのまま |
Beta Was this translation helpful? Give feedback.
#2121 を
mainブランチにマージしました