Skip to content

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

Closed

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

Activity

  1. locked and limited conversation to collaborators on Dec 15, 2021
  2. converted this issue into a discussion #2827 on Dec 15, 2021
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