Search code examples
swaggerswagger-2.0swagger-editor

Swagger Editor shows the “Schema error: should NOT have additional properties” error for a path parameter


I am creating an OpenAPI (Swagger) definition and checking its validity in http://editor.swagger.io. For some reason, Swagger Editor shows this error:

Schema error at paths['/some-endpoint/{id}/name-and-address'].get.parameters[0]
should NOT have additional properties
additionalProperty: type, allowEmptyValue, enum, name, in, description, required
Jump to line 142

Below is my YAML file:

paths:
  '/some-endpoint/{id}/name-and-address':
    get:
      tags:
        - InvolvedParty
      summary: Retrieve basic information about...
      operationId: getNameAndAddressUsingGET
      produces:
        - '*/*'
      parameters:
        - name: id
          in: path
          description: The unique identification
          required: true
          type: string
          allowEmptyValue: false
          enum:
            - '@coderange[1'
            - 'infinity]'
      responses:
        '200':
          description: Success

I haven't added any other properties as the error message implies. How to fix this error?


Solution

  • Remove allowEmptyValue - it's only used with query and formData parameters, but not with path parameters.