cebe / php-openapi

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
MIT License
466 stars 88 forks source link

Wrong type hint for some properties #34

Closed jdomenechb closed 4 years ago

jdomenechb commented 5 years ago

As an example, in class Operation, requestBody property is defined as:

https://github.com/cebe/php-openapi/blob/13b91759f9daccd90729e1c246bab791f13e59c8/src/spec/Operation.php#L23

However, if the requestBody property is NOT in the contract, getting the property results in null. Therefore, the type hint should be updated to reflect that.

This might happen with other properties in the same or other objects: what I've just posted is an example.

cebe commented 4 years ago

Fixed, thanks for reporting!