I need oneOf in my schema:
class AerthlingsShopOffer(OneOfSchema):
"""Polymorphic offer type discriminated by the 'type' field."""
type_field = "type"
type_schemas = {
"character": AerthlingsCharacterOffer,
"mutation_point": AerthlingsMpOffer,
}
Marshmallow doesn't seem to support this. Fortunately, there is an extension, marshmallow-oneofschema. Unfortunately, when presented with the class above, apispec silently ignores it, producing
"AerthlingsShopOffer": {
"type": "object",
"properties": {}
},
and omitting AerthlingsCharacterOffer and AerthlingsMpOffer entirely.
I have a fix for this, but I think it requires discussion, and I have not yet written a unit test for it. If you think this is worth doing, I can complete the work and submit a PR. If not, that is no problem for me; I can continue to use my forked apispec in my own project.
I need
oneOfin my schema:Marshmallow doesn't seem to support this. Fortunately, there is an extension,
marshmallow-oneofschema. Unfortunately, when presented with the class above,apispecsilently ignores it, producingand omitting
AerthlingsCharacterOfferandAerthlingsMpOfferentirely.I have a fix for this, but I think it requires discussion, and I have not yet written a unit test for it. If you think this is worth doing, I can complete the work and submit a PR. If not, that is no problem for me; I can continue to use my forked
apispecin my own project.