Array schema name on the model
gdec31 opened this issue · comments
Hi,
Sorry I should see that yesterday when I write the #231.
The sub arrays name in the schema are not set too.
..
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"categories": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DtoCategory"
}
}, ..
Unfortunately there is no room to display in a pleasing way an additional property here. We could display that name when the object is collapsed, instead of showing [{...}]
it should show [{ DtoCategory }]
instead.
I'm not sure there is really an alternative here as a floating type isn't going to cut it here. I can recommend two better choices though:
- Define the
title
attribute of yourcategories
property, and it will be shown on the right hand side:
like this:
"error": {
"type": "array",
"title": "DtoResponse",
"items": {
"$ref": "#/components/schemas/DtoResponse"
}
},
- [Preferred] Switch to the advanced
Table
view of the spec, which includes these by default:
Fwiw, we could support a potentially 3rd option as well:
3. high fidelity alternatives to improve this view that correctly handle all the edge cases.
I don't think that's really an option I want to push on people, but if a design comes up that our team likes, I'm sure we wouldn't hesitate to throw it together.
Given those, I don't think there is anything concrete that we could do here, so I plan to close this issue. If for some reason the table
view has any issues, we would be more than happy to add any and all improvements to it.
It's ok to use table.
Thank you