Skip to content

Data Type Format validation #139

Open
@baurceanu

Description

@baurceanu

Hi, it might be an option to add validation of data type format.
Use case:
Date time format validation.
On my current project we use custom formats (not ISO / RFC). So I'd like to have something like this in configuration:

<configuration>
    <validateDataTypeFormat>true</validateDataTypeFormat>
    <customDataTypeFormats>
        <customDataTypeFormat>my-date-time</customDataTypeFormat> 
    </customDataTypeFormats>
    <forbiddenDataTypeFormats>
        <forbiddenDataTypeFormat>date-time<forbiddenDataTypeFormat>
    </forbiddenDataTypeFormats>
</configuration>

By default all standard OAS formats are allowed and all custom formats are forbidden.

Valid schema:

User:
  type: object
  properties:
    birthDateTime:
      type: string
      format: my-date-time

Not valid schema:

User:
  type: object
  properties:
    birthDateTime:
      type: string
      format: date-time

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions