I'm trying to upgrade from Swashbuckle 4 to 5 and swagger 1.2 to 2.
The issue I'm having is the response schema isn't showing up correctly if the response has another object within it.
While using Swagger 1.2 my Model Schema looked like this:
{
"Id": "",
"FirstName": "",
"LastName": "",
"Address": {
"StreetNumber": "",
"City": "",
"PostalCode": ""
},
"Preferences": [
{
"Name": "",
"Brand": "",
"MarketingName": ""
}
]
}
And the model was:
Customer {
Id (string, optional),
FirstName (string, optional),
LastName (string, optional),
Address(Address, optional),
Preferences(array[Preference], optional)
}
Address {
StreetNumber (string, optional),
City (string, optional),
PostalCode (string, optional)
}
Preference{
Name (string, optional),
Brand (string, optional),
MarketingName (string, optional),
}
Now the model schema is:
{
"Id": "",
"FirstName": "",
"LastName": "",
"Preferences": [
null,
]
}
And the model is:
Customer {
Id (string, optional),
FirstName (string, optional),
LastName (string, optional),
Address(#/definitions/Address, optional),
Preferences(Array[#/definitions/Preference, optional)
}
The JSON hasn't really changed. From swagger 1.2 to 2.0 the response type has moved from type to responses ref but the JSON appears to be correct and if Preferences or address isn't nested within Customer it appears correctly in the UI.
How can I get the models for Address and preference to appear in the Customers model?