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

marshmallow-jsonschema is not compatible with marshmallow.fields.Enum added in marshmallow v3.18.0 #169

Open
hf-kklein opened this issue Sep 16, 2022 · 1 comment · May be fixed by #170

Comments

@hf-kklein
Copy link
Contributor

marshmallow_jsonschema.exceptions.UnsupportedValueError: unsupported field type <fields.Enum(dump_default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, load_default=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'unknown': 'Must be one of: {choices}.'})>

See changelog: https://github.com/marshmallow-code/marshmallow/blob/dev/CHANGELOG.rst#3180-2022-09-15

hf-kklein added a commit to hf-kklein/marshmallow-jsonschema that referenced this issue Oct 9, 2022
to reproduce the issue fuhrysteve#169
improve test setup
hf-kklein added a commit to hf-kklein/marshmallow-jsonschema that referenced this issue Oct 9, 2022
This fixes fuhrysteve#169.
Detailed changes:
* Introduce distinction between Enums imports from `marshmallow_enum` and `marshmallow.fields` (the latter are refered to as "marshmallow native" Enums
* Add function to find out if the version of marshmallow used supports the native Enum type
* Add test cases that reproduce the issue
* Adapt the code to also support the native enums
hf-kklein added a commit to hf-kklein/marshmallow-jsonschema that referenced this issue Oct 9, 2022
This fixes fuhrysteve#169.

Detailed changes:
* Introduce distinction between Enums imports from `marshmallow_enum` and `marshmallow.fields` (the latter are refered to as "marshmallow native" Enums)
* Add function to find out if the version of marshmallow used supports the native Enum type
* Add test cases that reproduce the issue
* Adapt the code to also support the native enums
@hf-kklein
Copy link
Contributor Author

I opened a PR that fixes this issue: #170

hf-kklein added a commit to hf-kklein/marshmallow-jsonschema that referenced this issue Oct 9, 2022
This fixes fuhrysteve#169.

Detailed changes:
* Introduce distinction between Enums imports from `marshmallow_enum` and `marshmallow.fields` (the latter are refered to as "marshmallow native" Enums)
* Add function to find out if the version of marshmallow used supports the native Enum type
* Add test cases that reproduce the issue
* Adapt the code to also support the native enums
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

Successfully merging a pull request may close this issue.

1 participant