Skip to content

Conversation

@paulmach
Copy link
Contributor

This is part 2 of the fix for #1611.

The issues is that something like the below doesn't work.

type: object
properties:
 start_port:
   $ref: "#/components/schemas/port"
   x-order: 1
 end_port:
   $ref: "#/components/schemas/port"
   x-order: 2

First problem was the kin-openapi does not actually capture these values from the yaml/json. This fixed in getkin/kin-openapi#901, release in v0.126.0 and pulled in here in #1689

This is the second part which actually considers this value in the sort and officially fixes #1611. It first checks for "next to $ref" then if there is an x-order in the schema referenced.

@paulmach paulmach requested a review from a team as a code owner July 13, 2024 06:08
@jamietanna jamietanna self-assigned this Jul 14, 2024
@AndrewCopeland
Copy link

I made a comment on the original issue that was closed #1611.

Seems like we are waiting on this PR to be merged to resolve this bug.

Jamie Tanna added 3 commits July 24, 2024 09:35
@jamietanna jamietanna changed the title use the x-order from next to $ref if present fix(extensions): use the x-order from next to $ref if present Jul 24, 2024
@jamietanna jamietanna changed the title fix(extensions): use the x-order from next to $ref if present fix(extensions): use the x-order from next to $ref, if present Jul 24, 2024
@jamietanna jamietanna added bug Something isn't working area:extensions labels Jul 24, 2024
@jamietanna jamietanna enabled auto-merge (squash) July 24, 2024 08:48
Copy link
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! Added in an additional case, and a couple of comments :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:extensions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x-order not respected when using $ref

3 participants