Skip to content

Extensible format validator #1

@kpy3

Description

@kpy3

Hello,

SWAG/OpenAPI specification has parameter attribute called format which can be used to specify acceptable format for given type. For example one can specify following:

schema:
    type: object
    properties:
        startDate:
            type: string
            format: date

where date could be an RFC3339 date ("yyyy-mm-dd"). This specification can (and should) be used for validation before passing data to underlying handler. Another examples are URL, email, phone number or zip code. These formats need special attention because they may have different format for different countries (or API requirements), therefore there should be ability to specify validator for format in addition to some standard validators (for formats defined in OpenAPI specification).

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