Skip to content

Question: Is it possible define minimum and maximum limits for date/datetime #2822

@Havunen

Description

@Havunen

Hi,

I have been trying to figure out how I could add limits to datetime / date based properties / values in open api 3 schema.

https://swagger.io/docs/specification/data-models/data-types/

describes that string can have min length and max length properties but I would like to provide minimum and maximum value for the date

type: string
minLength: 3
maxLength: 20

Something similar what integer has:

type: integer
minimum: 1
maximum: 20

Something like this?

type: string
format: date
minimum: 1996-12-19
maximum: 2021-12-19

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