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

Generate schema properties in the original order #1722

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

diamondburned
Copy link

This commit temporarily switches to a fork of kin-openapi that provides
the original ordering of the Properties object. This provides a way for
this tool to generate the properties in the original order as they were
written in the YAML file.

This commit temporarily switches to a fork of kin-openapi that provides
the original ordering of the Properties object. This provides a way for
this tool to generate the properties in the original order as they were
written in the YAML file.
@diamondburned
Copy link
Author

#1388 will essentially replace this PR with a few simple tweaks -_-

See pb33f/libopenapi#205

@mromaszewicz
Copy link
Member

Property ordering is cosmetic, and it doesn't affect behavior, so it's better to stay on the official release of kin-openapi than to use someone else's fork.

Why is it important to preserve property order in generated code that you won't be editing?

@diamondburned
Copy link
Author

Property ordering is cosmetic, and it doesn't affect behavior, so it's better to stay on the official release of kin-openapi than to use someone else's fork.

Right. There's a PR for this to kin-openapi, which is why this PR is a draft. See getkin/kin-openapi#1003.

Why is it important to preserve property order in generated code that you won't be editing?

Because the Go types are used for documentation when writing Go code. It is what you see first when you Go to Definition, not an external OpenAPI documentation.

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.

2 participants