Skip to content

InvalidSchemaFormatValue exception when unmarshalling string with format 'byte' #261

@eiband

Description

@eiband

When validating a property of type

type: string
format: byte

it is assumed that the base64 encoded value can be represented as utf-8 string. As a result InvalidSchemaFormatValue is raised when unmarshalling binary data which can't be represented as utf-8 string, e.g. the value base64.b64encode(b'\xff').

The exception text is:
Failed to format value /w== to format byte: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte.

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