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

Discriminator mapping throws validation error on valid discriminator mapping and accepts incorrect one. #199

Closed pjordaan closed 8 months ago

pjordaan commented 8 months ago

Example found on https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/ in the section "Mapping Type Names" The mapping section doesn't work with $ref references, but is a string that is being used as reference

If I add a mapping as found on the openapi spec site, i get a validation error that he expects a Reference object, but that is incorrect. If i replace it with a Reference object, this libary says it's correct, but swagger ui and swagger editor say they expect a string and not an object.

Can this be fixed? For now I can just not fill in a mapping, but I prefer I could fill it in.

pjordaan commented 8 months ago

Never mind, I looked incorrectly. The issue was in my code.