You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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: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).The text was updated successfully, but these errors were encountered: