Skip to content

Sort schema properties? #162

Answered by thim81
luchsamapparat asked this question in Q&A
Jun 3, 2025 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

hi @luchsamapparat

The --sortComponents works only on the level of the component elements, it does not sort the properties in the elements.

example:

components:
  schemas:
    UserDto:
      type: object
      properties:
        lastName:
          type: string
        firstName:
          type: string
    AccountDto:
      type: object
      properties:
        lastName:
          type: string
        firstName:
          type: string

Becomes:

components:
  schemas:
    AccountDto:
      type: object
      properties:
        lastName:
          type: string
        firstName:
          type: string
    UserDto:
      type: object
      properties:
        lastName:
          type: string

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@luchsamapparat
Comment options

@thim81
Comment options

@thim81
Comment options

Answer selected by luchsamapparat
@thim81
Comment options

@luchsamapparat
Comment options

@luchsamapparat
Comment options

@thim81
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants