Skip to content

yaml-schema provides an error when required: true in path- parameters #1088

@SergeDelchambre

Description

@SergeDelchambre

Describe the bug

In a path parameter definition, the plugin returns an error when using
required: true

Value is not accepted. Valid values: true.yaml-schema: OpenAPI 3.0.X(1)

example
'/pet/{petId}':
get:
tags:
- pet
summary: Find pet by ID
description: Returns a single pet
operationId: getPetById
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
format: int64

Expected Behavior

We should not have the error.
Moreover, the system proposes us the value "true" which is the value in the code

Current Behavior

Error is raised
Value is not accepted. Valid values: true.yaml-schema: OpenAPI 3.0.X(1)

Steps to Reproduce

  1. Activate the plugin Yaml (Redhat) version 1.18
  2. Activate a plugin to render the API (I use "OpenAPI (Swagger) Editor" from 42Crunch version 4.35)
  3. Open the yaml petstore from https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
  4. Error will pop-up in line 171

Environment

  • [ x] Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Assignees

No one assigned

    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