Skip to content

SwaggerConverter drops some validation properties of body parameters #673

@mkauf

Description

@mkauf

These properties are all dropped when converting the following Swagger 2.0 specification to an OpenAPI 3.0 specification with io.swagger.v3.parser.converter.SwaggerConverter:

  • multipleOf
  • minimum
  • maximum
  • exclusiveMinimum
  • exclusiveMaximum
  • uniqueItems
  • minLength
  • maxLength
  • pattern
---
swagger: '2.0'
info:
  version: 1.0.0
  title: Test
paths:
  "/integer":
    post:
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        required: true
        schema:
          type: integer
          format: int32
          multipleOf: 3
          minimum: 5
          maximum: 7
          exclusiveMinimum: true
          exclusiveMaximum: true
  "/array":
    post:
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        required: true
        schema:
          type: array
          items:
            type: string
          uniqueItems: true
  "/string":
    post:
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        required: true
        schema:
          type: string
          minLength: 2
          maxLength: 7
          pattern: aaa

I have tested swagger-parser 2.0.0-rc3.

Metadata

Metadata

Assignees

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