cebe / php-openapi

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

Allow a more convenient method of working with "x-" specifications #121

Open googoogajoob opened 2 years ago

googoogajoob commented 2 years ago

First Point: Excellent project. I've written an OpenApi loader myself. Yours is much better.

Second Point: The openapi specification of keywords allows for the possibility of extending them with the "x-" syntax: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions

In a project I am working on we have made use of this feature. When using cebe/php-openapi I've run into a problem.

Herrick19 commented 2 years ago

Sorry to jump in this discussion, but I feel like this is an "unneeded" feature request...

PHP support this syntax to access properties with "-" in variable names:

$Operation->{'x-foo-bar'}

and it works well, I have no issue at all accessing extension having a "-" in their name...

Hope this helps

fxedel commented 1 year ago

Is this already fixed by #113? E.g. $info->getExtensions()['x-extra-var']