-
Notifications
You must be signed in to change notification settings - Fork 938
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
Examples property of different object #1560
Comments
Created a scratch test illustrating the use, see #1561. The spec says Should be: #[OA\Schema(
...
examples: [
new OA\Examples(
example: 'Example 1', |
Thank for answer, but as I can see from you code you showed the usage of 'examples' attribute of QueryParameter class, which was not problem in this particalar issue. The problem is that there are no same attributes in Schema class and its Property class, only single example attributes: swagger-php/src/Attributes/Schema.php Line 59 in d3265da
swagger-php/src/Attributes/Property.php Line 60 in d3265da
How is it possible to produce "examples" for Schema and schema`s properties with "example" attribute? |
Ha! Got me there. I suppose Using spectral it seems Did some more surgery on the PR - should work now. |
Still, validator from https://editor-next.swagger.io/ tells "property "example" is deprecated, use "examples" instead" for Schema`s properties also.
Produced by:
|
According to https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#fixed-fields-20, 'example' property was renamed to 'examples' (I think the same right for schema``s properties, but this is not clear enough from spec).
Anyway, with 3.1.0 version of Generator it renders 'example' property:
This is produced with code inside OA\Schema
The same happens with OA\Property`s 'example' prop.
The text was updated successfully, but these errors were encountered: