Skip to content

Add support for the x-order extension.#627

Closed
psyhatter wants to merge 1 commit into
oapi-codegen:masterfrom
psyhatter:x-order-support
Closed

Add support for the x-order extension.#627
psyhatter wants to merge 1 commit into
oapi-codegen:masterfrom
psyhatter:x-order-support

Conversation

@psyhatter

Copy link
Copy Markdown
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

funvit commented Jun 13, 2022

Copy link
Copy Markdown

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

stevenh commented Nov 12, 2022

Copy link
Copy Markdown
Contributor

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

Pe-te commented Jun 19, 2023

Copy link
Copy Markdown

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

filintod commented Aug 9, 2023

Copy link
Copy Markdown
Contributor

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

@jamietanna

Copy link
Copy Markdown
Member

Closed by #1190

@jamietanna jamietanna closed this Jan 25, 2024
@psyhatter

Copy link
Copy Markdown
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