Value is not accepted. Valid values: true

I’m using 4.36.0 of the OpenAPI (Swagger) Editor VS Code extension.

I’ve got this snippet of definition:

      parameters:
        - in: path
          name: resource_id
          description: ID of the resource to return
          required: true
          schema:
            $ref: "#/components/schemas/Resource_id"

The line required: true is reporting the error given in the topic subject. I’ve reviewed the OpenAPI specification and I believe that I’ve got the syntax correct. If I copy/paste the entire specification into Swagger Editor, it does NOT complain.

Hi @Philip_Colmer :wave:

I can reproduce the same error.

At first glance it doesn’t look to be generated by the OpenAPI editor or API Audit check directly, so I suspect its a bug with the dependency YAML Redhat extension, but I’ll take a close look and see if there’s a solution…

Anthony

1 Like

Indeed its a bug with the Redhat YAML extension.
redhat-developer/vscode-yaml#1116

You can temporarily downgrade the YAML extension to v1.17.0:

I confirmed the error isn’t displayed after this change:

1 Like

Thank you SO much for your investigation of this, @Anthony - brilliant!

I can confirm that downgrading the YAML extension to 1.17.0 removes the errors, and it looks like it will be fixed in 1.18.0.

Thanks again.

1 Like