If I define the following spec on Apiary.io:
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# Test
## Root [/]
### Get Everything [GET]
+ Response 200 (application/json)
+ Attributes
+ example1 (string, optional, nullable) - An optional nullable string
+ example2: value (string, optional, nullable) - An optional nullable string with a sample value
+ Response 201 (application/json)
+ Attributes
+ example1 (Example, optional, nullable) - An optional nullable Example
+ example2: value (string, optional, nullable) - An optional nullable string with a sample value
# Data Structures
## Example
+ title (optional, nullable)
+ description (optional, nullable)
then I see the generated response structures below:
Response 200
{
"example1": null,
"example2": "value"
}
Response 201
{
"example1": {
"title": null,
"description": null
},
"example2": "value"
}
I expected the second response structure to match that of the first response.
If I update my Data Structure section to:
# Data Structures
## Example
+ title (optional)
+ description (optional)
then the generated response for status code 201 becomes
{
"example1": {},
"example2": "value"
}
Again, I would have expected this to match the structure of the status code 200 response. What am I not understanding here?