We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Marshmallow, you can order the fields by using class Meta: ordered = True, like:
class Meta: ordered = True
class FooSchema(Schema): b = fields.Int() a = fields.int() class Meta: ordered = True for k in FooSchema.fields(): print(k)
This will output:
b a
However, the schema generated by apispec ordered the fields alphabetically.
Shouldn't it default to Marshmallow's natural order?
Is there any workaround to get the fields ordered correctly?
Thank you.
The text was updated successfully, but these errors were encountered:
apispec respects schema order.
You may want to double-check your code doesn't force alphabetical order (for instance, by default, Flask sorts keys when serializing json).
Sorry, something went wrong.
Closing for lack of feedback. Free free to bring additional details in comments.
No branches or pull requests
In Marshmallow, you can order the fields by using
class Meta: ordered = True
, like:This will output:
However, the schema generated by apispec ordered the fields alphabetically.
Shouldn't it default to Marshmallow's natural order?
Is there any workaround to get the fields ordered correctly?
Thank you.
The text was updated successfully, but these errors were encountered: