Skip to content

Commit

Permalink
Populate ovf_Section_Type so it isn't removed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ccouzens committed Jul 16, 2020
1 parent d6e538f commit adcdc8d
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 8 deletions.
32 changes: 31 additions & 1 deletion transformer/src/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,37 @@ pub fn schemas<R: Read + Seek>(
"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()
},
)),
}),
);

Expand Down
12 changes: 11 additions & 1 deletion website/27.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -41317,7 +41317,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/29.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -43529,7 +43529,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/30.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -43600,7 +43600,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/31.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -44866,7 +44866,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/32.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -45770,7 +45770,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/33.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -46481,7 +46481,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion website/34.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -46370,7 +46370,17 @@
"additionalProperties": false
},
"ovf_Section_Type": {
"type": "object"
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
}
}
}
},
Expand Down

0 comments on commit adcdc8d

Please sign in to comment.