swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

parsing a v3.1.0 spec omits defined minLength

Open spacether opened this issue 3 years ago • 0 comments

swagger-parser version: 2.1.1 spec: defined below below

Issue: parsing of component schema MinLengthValidationWithADecimal omitsthe existing minLength from the parser result

Here is the pasted parser result for that schema:

MinlengthValidationWithADecimal -> {JsonSchema@4942} "class JsonSchema {
    class Schema {
        type: null
        format: null
        $ref: null
        description: null
        title: null
        multipleOf: null
        maximum: null
        exclusiveMaximum: null
        minimum: null
        exclusiveMinimum: null
        maxLength: null
        minLength: null
        pattern: null
        maxItems: null
        minItems: null
        uniqueItems: null
        maxProperties: null
        minProperties: null
        required: null
        not: null
        properties: null
        additionalProperties: null
        nullable: null
        readOnly: null
        writeOnly: null
        example: null
        externalDocs: null
        deprecated: null
        discriminator: null
        xml: null
        patternProperties: null
        contains: null
        $id: null
        $anchor: null
        $schema: https://json-schema.org/draft/2020-12/schema
        const: null
        contentEncoding: null
        contentMediaType: null"

spec:

openapi: 3.1.0
servers:
- url: https://someserver.com/v1
info:
  title: openapi 3.1.0 sample spec
  version: 0.0.1
  description: sample spec for testing openapi functionality, built from json schema
    tests for draft2020-12
tags: []
paths: {}
components:
  schemas:
    MinlengthValidationWithADecimal:
      $schema: https://json-schema.org/draft/2020-12/schema
      minLength: 2.0

spacether avatar Sep 19 '22 17:09 spacether