spot icon indicating copy to clipboard operation
spot copied to clipboard

Extended interface property order

Open jankuca opened this issue 5 years ago • 0 comments

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" }
  }
}

jankuca avatar Dec 10 '20 10:12 jankuca