Skip to content

Add support for the x-order extension. #627

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

Closed
wants to merge 1 commit into from

Conversation

psyhatter
Copy link
Contributor

Fix for #458.
Can be used when you need to set the order of fields in the model:

    NewPet:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          x-order: 1
        tag:
          type: string
          x-order: 2

@funvit
Copy link

funvit commented Jun 13, 2022

I am think readme must be updated too...

Fix for oapi-codegen#458.
Can be used when you need to set the order of fields in the model:
```yaml
    NewPet:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          x-order: 1
        tag:
          type: string
          x-order: 2
```
@stevenh
Copy link
Contributor

stevenh commented Nov 12, 2022

While this works, could it be simplified to just an x-ordered e.g.

    NewPet:
      type: object
      required:
        - name
      properties:
        x-ordered: true    
        name:
          type: string
        tag:
          type: string

This then uses the order of the properties, without having to put a flag on every field?

Alternatively a configuration flag might be nice, so you don't have to scatter x-order... throughout specs.

@Pe-te
Copy link

Pe-te commented Jun 19, 2023

Hi, all those referenced commits don't seem to exists anymore?
Will this make it into master soon or any way to check the commits out directly?
Is there maybe an alternative way to get ordered properties?

@filintod
Copy link
Contributor

filintod commented Aug 9, 2023

I created this PR #1190 based off this one, resolving issues with master and minor refactors

@jamietanna
Copy link
Member

Closed by #1190

@jamietanna jamietanna closed this Jan 25, 2024
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

Successfully merging this pull request may close these issues.

6 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