cebe / cebe/php-openapi

References to incorrect components should be considered invalid

Offen
#171 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
500
Forks
99
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Expected
Referencing a component that does not meet the criteria an object requires should be considered invalid.

### Example
A Response object referencing a component that does not contain a "description" should be considered invalid.

![image](https://user-images.githubusercontent.com/102669158/197182089-42527d49-7eb4-4753-8c81-525187204b92.png)

### Reasoning
["description" is a **REQUIRED** property for a Response object](https://spec.openapis.org/oas/v3.1.0#response-object).

## Actual
Referencing a component that does not meet the criteria an object requires is considered valid.

### Example

```php
$api = Reader::readFromJson(<<validate()); // bool(true)
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the Reader::readFromJson example and the $api->validate() call, then trace how the response $ref is resolved and validated against the referenced component. Add a regression case for a response referencing an invalid schema component; done means validation rejects the example instead of returning true.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
api
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.