Skip to content

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
@psyhatter
Copy link
Contributor Author

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

@filintod Great work, thank you so much!

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