Skip to content
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

feat(core): property sorting #1763

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

AllieJonsson
Copy link
Contributor

Status

READY/HOLD

Description

Fixes #1737
Not sure if this is a good way to go, ordering of properties seems irrelevant in the end (no functionality difference), so I'm not sure if this is what we want. I'll let you Maintainers decide :)

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Comment on lines +74 to +75
const entries = Object.entries(item.properties);
if (context.output.propertySortOrder === PropertySortOrder.ALPHABETICAL) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only difference here, the rest is just whitespace changes

melloware
melloware previously approved these changes Dec 21, 2024
Copy link
Collaborator

@melloware melloware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soartec-lab
Copy link
Member

That's a good improvement.
It's great to make the sorting rules explicit and consistent.
In my opinion, it's better to be consistent with the order defined in the open API.

@AllieJonsson
Copy link
Contributor Author

Ill change the default to be Specification instead!

Copy link
Member

@soartec-lab soartec-lab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for great enhance!

@melloware melloware merged commit c0eba70 into orval-labs:master Dec 23, 2024
2 checks passed
@AllieJonsson AllieJonsson deleted the feat/property-sorting branch December 23, 2024 13:17
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.

Add sortFields = true|false to disable sorting when generating the model
4 participants