From adcdc8d45515b790faadf558c5a41c7ec84db472 Mon Sep 17 00:00:00 2001 From: Chris Couzens Date: Thu, 16 Jul 2020 14:42:20 +0100 Subject: [PATCH] Populate ovf_Section_Type so it isn't removed OpenApi Generator is likely to do the following: Model ovf_Section_Type not generated since it's a free-form object Which then means the generated code doesn't work. By giving it a field, it should be possible to avoid this behaviour --- transformer/src/schemas.rs | 32 +++++++++++++++++++++++++++++++- website/27.0.json | 12 +++++++++++- website/29.0.json | 12 +++++++++++- website/30.0.json | 12 +++++++++++- website/31.0.json | 12 +++++++++++- website/32.0.json | 12 +++++++++++- website/33.0.json | 12 +++++++++++- website/34.0.json | 12 +++++++++++- 8 files changed, 108 insertions(+), 8 deletions(-) diff --git a/transformer/src/schemas.rs b/transformer/src/schemas.rs index f611bad..5d2aeb0 100644 --- a/transformer/src/schemas.rs +++ b/transformer/src/schemas.rs @@ -63,7 +63,37 @@ pub fn schemas( "ovf_Section_Type".to_owned(), ReferenceOr::Item(openapiv3::Schema { schema_data: Default::default(), - schema_kind: openapiv3::SchemaKind::Type(openapiv3::Type::Object(Default::default())), + schema_kind: openapiv3::SchemaKind::Type(openapiv3::Type::Object( + openapiv3::ObjectType { + properties: [( + "info".to_string(), + openapiv3::ReferenceOr::boxed_item(openapiv3::Schema { + schema_data: Default::default(), + schema_kind: openapiv3::SchemaKind::Type(openapiv3::Type::Object( + openapiv3::ObjectType { + properties: [( + "value".to_string(), + openapiv3::ReferenceOr::boxed_item(openapiv3::Schema { + schema_data: Default::default(), + schema_kind: openapiv3::SchemaKind::Type( + openapiv3::Type::String(Default::default()), + ), + }), + )] + .iter() + .cloned() + .collect(), + ..Default::default() + }, + )), + }), + )] + .iter() + .cloned() + .collect(), + ..Default::default() + }, + )), }), ); diff --git a/website/27.0.json b/website/27.0.json index b773586..0d9af6a 100644 --- a/website/27.0.json +++ b/website/27.0.json @@ -41317,7 +41317,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/29.0.json b/website/29.0.json index edec076..7899405 100644 --- a/website/29.0.json +++ b/website/29.0.json @@ -43529,7 +43529,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/30.0.json b/website/30.0.json index dfecc64..44f76c5 100644 --- a/website/30.0.json +++ b/website/30.0.json @@ -43600,7 +43600,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/31.0.json b/website/31.0.json index 7d12a5b..150d64f 100644 --- a/website/31.0.json +++ b/website/31.0.json @@ -44866,7 +44866,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/32.0.json b/website/32.0.json index 03a07d4..dc59186 100644 --- a/website/32.0.json +++ b/website/32.0.json @@ -45770,7 +45770,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/33.0.json b/website/33.0.json index 6d4c43a..fb93747 100644 --- a/website/33.0.json +++ b/website/33.0.json @@ -46481,7 +46481,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } }, diff --git a/website/34.0.json b/website/34.0.json index 6830fe3..017a470 100644 --- a/website/34.0.json +++ b/website/34.0.json @@ -46370,7 +46370,17 @@ "additionalProperties": false }, "ovf_Section_Type": { - "type": "object" + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } } } },