Skip to content

Question on ordering of fields #226

Answered by wyfo
CaptainDriftwood asked this question in Q&A
Discussion options

You must be logged in to vote

There are several issue here: a misuse due to an incomplete documentation, a bug, and maybe a feature request.

On the one hand, about the documentation; apischema has several features expecting fields as argument, for example fields validator or ordering. This not really documented, but fields can be passed either as a dataclass field (convenient inside class body), apischema.objects.ObjectField or a string, which is expected to be the field name. Field alias cannot be used here, so your example will not work. You have to replace "hairColor" by "hair_color".

On the other hand, there is a bug in the current implementation (i will fix it today and release it in v0.16.1 at the same time). Or…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@wyfo
Comment options

@CaptainDriftwood
Comment options

@wyfo
Comment options

@wyfo
Comment options

@CaptainDriftwood
Comment options

Answer selected by CaptainDriftwood
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