marshmallow-jsonschema icon indicating copy to clipboard operation
marshmallow-jsonschema copied to clipboard

Any type (or Raw field) uses type as string, and when used in Dict, adds str, null as types in additional properties

Open ryan-lane opened this issue 2 years ago • 0 comments

When using Any field, the type is set to string, and when used in a Dict, it sets the types in the additional properties to string, null. This leads to an inconsistency between marshmallow-dataclass and marshmallow-schema, where:

{"myfield": {"sub-dict": ["a", "b"]}}

Will be valid via marshmallow, but will not validate using the jsonschema.

I'm not fully sure what the type should be when used directly for fields, but in additionalProperties, if the type is Any, it shouldn't include the types field at all.

ryan-lane avatar Apr 21 '22 09:04 ryan-lane