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

Auto-generated schema does not respect load_only flag… #108

Open
zedrdave opened this issue Apr 28, 2018 · 2 comments
Open

Auto-generated schema does not respect load_only flag… #108

zedrdave opened this issue Apr 28, 2018 · 2 comments

Comments

@zedrdave
Copy link

I noticed that, when generating the doc, the load_only flag is not respected, and fields marked as such will appear in the description of the output schema.

Serialisation itself seems to be done correctly and the field does not seem to be returned by the query.

From what I can see, this is due to the (expected) behaviour of fields2jsonschema, which does not exclude load_only fields:
marshmallow-code/apispec#119

I am not too sure why serialisation works (wouldn't it get the same schema?)… But in any case, do you have any opinion on what would be the best way to fix this?

I guess one option is to create a DumpOnlySchema mixin similar to what is being done by PostFormParameters for dump_only fields? Any better way?

@frol
Copy link
Owner

frol commented Apr 28, 2018

I will try to dig into the problem later today. Thank you for reporting this!

@frol
Copy link
Owner

frol commented Apr 28, 2018

Yeah, that is a bummer. I think this should be fixed in apispec.

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

No branches or pull requests

2 participants