cebe / cebe/php-openapi

validate() returns true with wrong top level elements

Open
#84 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
500
Forks
99
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the example through Reader::readFromJson(), resolveReferences(), and validate() using an OpenAPI 3 document with a misspelled top-level property such as "AAAAAcomponents". Inspect how validation handles unknown top-level elements; done means the behavior is clarified and invalid documents are handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.