Skip to content

Instantly share code, notes, and snippets.

@mvantellingen
Created December 18, 2018 12:51
Show Gist options
  • Save mvantellingen/71a1a2f53a94b0fbc3eb95714a194a4f to your computer and use it in GitHub Desktop.
Save mvantellingen/71a1a2f53a94b0fbc3eb95714a194a4f to your computer and use it in GitHub Desktop.
Code Blog #2
class AttributeDefinitionDraftSchema(marshmallow.Schema):
type = helpers.Discriminator(
discriminator_field=("name", "name"),
discriminator_schemas={
"boolean": "AttributeBooleanTypeSchema",
"datetime": "AttributeDateTimeTypeSchema",
},
unknown=marshmallow.EXCLUDE,
allow_none=True
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment