You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow a more convenient method of working with "x-" specifications #121
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.
openapi requires the use of the "x-" syntax
php interprets "x-" not as a variable (or something similar) but sees the "-" as an operation. Particularly with the function isset()
cebe/php-openapi relies on the native php convention variable/(class attribute names)
When using isset() to determine if a keyword has been specified PHP reports an error. I have been able to work around this problem by using getSerializableData(). However it would be nice and more convenient if one could access openapi variables (keywords) which use a "-" as part of their name.
Activity
Herrick19 commentedon Feb 20, 2022
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 commentedon Oct 11, 2022
Is this already fixed by #113? E.g.
$info->getExtensions()['x-extra-var']