Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix documentation of default from missing with marshmallow 3 #490
It sucks not being able to document default values automatically, especially since it would probably work most of the times, but I don't see a safe way to do it.
Without this feature removal, we may pass to the spec dict objects that are not json serializable, which will trigger an exception when serializing the spec file.
This. As a user, I want apispec to work mostly transparently, i.e. without having to modify my app code.
Maybe we could handle errors better to lead the user toward using
Well, we could try to dump the
I don't know if we should document the
I just pushed a new commit to serialize
It has a few smells:
We should probably only document missing for fields that are not dump_only. It doesn't make sense anyway, does it?
Also, I'd need to add proper tests to show it works with a field where this matters, such as
Indeed we shouldn't document default on a
So shall we call
Or rather than passing
2 times, most recently
Sep 2, 2019
I added a piece of doc about
Maybe not but a field with
changed the title
WIP - Fix documentation of default from missing with marshmallow 3
Sep 3, 2019
Sep 3, 2019
10 checks passed
Been checked out the past few days, but I like the recent changes. The only other thing I have been thinking about is extracting the logic for finding Schemas in OpenAPI objects from
It would also be convenient if the documentation for these methods was a little more clear about the expected structure of the input and where schemas could go. Part of the rational for pulling all the logic out would be to improve documentation and understandably, but we could also just improve the documentation of the methods as they are now.
To follow the pattern in #493, we could do
class MarshmallowPlugin(BasePlugin): SchemaResolver = SchemaResolver class MyMarshmallowPlugin(MarshmallowPlugin): class SchemaResolver(MarshmallowPlugin.SchemaResolver): def resolve_parameters(...): ...