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

Keep struct fields order in schema #538

Open
Sufflope opened this issue Sep 18, 2024 · 0 comments · May be fixed by #539
Open

Keep struct fields order in schema #538

Sufflope opened this issue Sep 18, 2024 · 0 comments · May be fixed by #539

Comments

@Sufflope
Copy link
Contributor

Struct fields are stored in a BTreeMap in schema properties, this sorts them alphabetically.

But, often, at least in my projects, struct fields order has some semantic meaning (e.g. in one project I have a Span struct with start and end fields, and others; it makes sense to have those two fields one after the other, and in this order).

I think it would make more sense in general to keep the fields order (if you want them alphabetically sorted, you'll probably sort them in your struct anyway?).

Sufflope added a commit to Sufflope/paperclip that referenced this issue Sep 18, 2024
@Sufflope Sufflope linked a pull request Sep 18, 2024 that will close this issue
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 a pull request may close this issue.

1 participant