cebe / php-openapi

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
MIT License
464 stars 87 forks source link

Do not assume Reference when Schema is requested #185

Open provokateurin opened 1 year ago

provokateurin commented 1 year ago

I have a problem with the following spec:

{
  "type": "object",
  "additionalProperties": {
    "nullable": true,
    "$ref": "#/components/schemas/Reference"
  }
}

The problem is that the code assumes it is a Reference when $ref is set, but that is actually not true in this case since it is a proper Schema.

Dirty fix I tried before properly debugging this: https://github.com/cebe/php-openapi/pull/184