Skip to content
This repository was archived by the owner on Mar 24, 2024. It is now read-only.
This repository was archived by the owner on Mar 24, 2024. It is now read-only.

Validation with items missing field name #253

Description

@lsbardel

The following dataclass

@dataclass
class Permission:
    methods: List[str] = fields.data_field(
        description="Http methods affected by this permission",
        items=fields.str_field(
            description="Http method",
            validator=fields.Choice(ALL_HTTP_METHODS),
        ),
    )
    path: str = fields.str_field(description="api path", required=True)
    action: str = fields.str_field(
        validator=fields.Choice(("allow", "deny")), default="allow"
    )

raise the following validation error when methods has wrong values.

{'errors': [{'field': 'permissions', 'message': {'null': 'foo not valid'}}]}

the field is missing and null is inserted instead

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions