kin-openapi icon indicating copy to clipboard operation
kin-openapi copied to clipboard

Validation of 3.0.3 schema fails

Open andig opened this issue 6 months ago • 3 comments

Validation fails for this file but is fine in https://oas-validation.com/.

bad data in "#/components/parameters/soc" (expecting ref to schema object)

Parameters:

    soc:
      name: soc
      description: SOC in %
      in: path
      required: true
      schema:
        $ref: "#/components/schemas/Soc"

Schemas:

    Soc:
      description: SOC in %
      type: number
      example: 60
      minimum: 0
      maximum: 100

It's unclear to me what could be the root cause- the schema object seems to exist?

rest-api.yaml.txt

Refs https://github.com/evcc-io/docs/issues/823

andig avatar Jun 23 '25 09:06 andig

Please use https://github.com/getkin/kin-openapi#validating-an-openapi-document and upload a /minimally/ reproducing OpenAPI spec. I'm not going to do this for you.

fenollp avatar Jun 23 '25 12:06 fenollp

Thank you, wasn‘t aware of this.

andig avatar Jun 23 '25 12:06 andig

No additional insights:

go run github.com/getkin/kin-openapi/cmd/validate@latest rest-api.yaml.txt 
2025/06/23 20:51:46 Loading error: bad data in "#/components/parameters/soc" (expecting ref to schema object)
exit status 1

andig avatar Jun 23 '25 18:06 andig