Skip to content

fix(extensions): use the x-order from next to $ref, if present #1700

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

Merged
merged 4 commits into from
Jul 24, 2024

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.

@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 :)

@jamietanna jamietanna merged commit 08bd55b into oapi-codegen:main Jul 24, 2024
14 checks passed
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy