-
Notifications
You must be signed in to change notification settings - Fork 95
Should x-* references be parsed? #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
have you called |
I'm having a similar issue. If I define a path that contains an x-* attribute without using a reference then: $spec->paths['path']->{'x-*'} contains the value of the x-* attribute. However, if the path only contains: $ref: 'filename.yaml' where filename.yaml has the x-attribute defined, then: $spec->paths['path']->{'x-*'} throws the exception: Exception: Getting unknown property: cebe\openapi\spec\PathItem::x-* I've worked around it for the moment in an odd way, if I define the path so that the x-* attribute is in the paths spec, followed by the $ref attribute, then I'm able to access the x-* property as expected. More specifically this works:
and this doesn't:
I'm unsure if this is clear enough, and if it is the same issue. If you need a working example, I can probably put it together. |
Reproduced, added a failing test case in #111. If someone wants to dig into fixing this, I'd be happy to merge a fix. Have no time to fix it myself right now. |
I'm using x-* extensions in a number of places and wanted to split up my OAS doc over multiple files. If I have a
x-subscription
content inline in the main file at root level, like this:Then after I do
$specs = Reader::readFromJsonFile(realpath($specPath));
I can access the subscriptions, egvar_dump($spec->{'x-subscriptions'});
gives me:But if I have:
with the full array moved to another file, the same
$spec
calls returns:I've tried a variety of ways (using 'allOf', having the array be in the root and reference individual events, etc.) but the reference doesn't resolve.
So I guess my question is; should it?
Thanks!
The text was updated successfully, but these errors were encountered: