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

SwaggerParser didn't return a validator messages when specification has schema with `additionalProperties` type `object` with reference

Open lnash94 opened this issue 2 years ago • 0 comments

Hi Currently, I'm using the swagger parser for getting parsing OpenAPI objects from my given specification.

SwaggerParseResult parseResult = new OpenAPIV3Parser().readContents(openAPIFileContent, null, parseOptions);
        if (!parseResult.getMessages().isEmpty()) {
...
}

The used parser didn't return the validator for the schema which has additionalProperties type object and has a reference. but when it Coding via the IDE returns as invalid usage of additionaltProperties.

IDE error Screenshot from 2022-11-22 09-42-20

example for

components:
  schemas:
    User:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
    User01:
      description: Additional properties with objects with reference fields
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      additionalProperties:
        type: object
        $ref: "#/components/schemas/User"
   

Could you please let me know if is this regarding the version issue? I'm using the latest version 2.1.9

lnash94 avatar Nov 22 '22 04:11 lnash94