openapi
openapi copied to clipboard
Use more definitions instead of repeating type data?
Hi, in at least the v2 spec, in JSON Pointer speak this:
/paths/~1v1~1accounts/post/parameters/0/schema/properties/legal_entity/additional_owners/properties
has string keys of "0", "1", ... and each of those values is identical:
"0": {
"properties": {
"address": {
"properties": {
"city": {
"type": [
"string"
]
},
etc. These could all each instead be:
"0": { "$ref": "#/definitions/legal_entity_definition" },
or similar. Out of the currently 41k line spec, that would already save about 100 x 30 = 3k. There are probably more examples.
Thanks for logging. And yes, it seems like a good idea to fix this.
I'm not sure I'll get to this soon as this part of the generator is a little involved. If size is a problem I'd suggest compression — even without these duplicates the spec is highly repetitive and a gzip should work really well.
If you'd publish that code I'd be pleased to provide a fix myself. However I'm more concerned with the "type is an array" incompatibility or the non-unique operationId
!
I apologize for the extremely delayed response. This has been fixed. We don't generate numerical string keys with duplicated values anymore.