spot
spot copied to clipboard
Extended interface property order
When an interface which extends another interface is converted to an OpenAPI schema, the properties from the extending interface appear above the base interface properties.
Does this make sense? I am rather considering this a bug.
To reproduce:
interface A {
a: string
}
interface B extends A {
b: string
}
Resulting OpenAPI schema:
{
"type": "object",
"properties": {
"b": { "type": "string" },
"a": { "type": "string" }
}
}
It would make more sense to me to if the properties from parent types appeared at the top:
{
"type": "object",
"properties": {
"a": { "type": "string" },
"b": { "type": "string" }
}
}