Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended interface property order #1170

Open
jankuca opened this issue Dec 10, 2020 · 0 comments
Open

Extended interface property order #1170

jankuca opened this issue Dec 10, 2020 · 0 comments

Comments

@jankuca
Copy link
Contributor

jankuca commented Dec 10, 2020

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" }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant