Skip to content
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

validate() returns true with wrong top level elements #84

Open
franksl opened this issue Dec 4, 2020 · 2 comments
Open

validate() returns true with wrong top level elements #84

franksl opened this issue Dec 4, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@franksl
Copy link

franksl commented Dec 4, 2020

Hi,
I tried to run validate like this:

$spec   = cebe\openapi\Reader::readFromJson($jsonstring);
$spec->resolveReferences(new cebe\openapi\ReferenceContext($spec, "/"));
$spec->validate();

on a OpenAPI 3 schema that has, for example the property "AAAAAcomponents" instead of "components", and the call returns true.
Is this correct?
Thanks,
Frank

@cebe
Copy link
Owner

cebe commented Dec 14, 2020

it is possible to extend the OpenAPI description. So adding properties is generally allowed. Strictly following the spec would mean that you need to prefix additional properties with x-.

@cebe
Copy link
Owner

cebe commented Dec 14, 2020

validation currently means to check if the existing elements are used correctly. It would be possible to add some kind of strict mode that would also complain about cases like yours.

@cebe cebe added the enhancement New feature or request label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants