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

Extends filter interface description with swagger options #819

Merged
merged 1 commit into from
Nov 2, 2016
Merged

Extends filter interface description with swagger options #819

merged 1 commit into from
Nov 2, 2016

Conversation

maechler
Copy link
Contributor

@maechler maechler commented Nov 1, 2016

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

It took me some time to figure out how to provide a description for a parameter, so I thought it might be useful to add this to the comment.

It took me some time to figure out how to provide a description for a parameter, so I thought it might be useful to add this to the comment.
Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add it in docs too.

@maechler
Copy link
Contributor Author

maechler commented Nov 1, 2016

I thought about that too, but the docs about custom filters only reference ApiPlatform\Core\Api\FilterInterface and all the information about the structure of the array provided by ApiPlatform\Core\Api\FilterInterface->getDescription() is in the comments. And I have not checked how it would be possible to add a description to existing filter implementations like e.g. ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter.

@dunglas dunglas merged commit c1eb73a into api-platform:master Nov 2, 2016
@dunglas
Copy link
Member

dunglas commented Nov 2, 2016

Thanks @maechler.

I would add a "Swagger" section with an example in this file: https://github.com/api-platform/docs/blob/master/core/filters.md

@@ -26,6 +26,7 @@
* - type: the type of the filter
* - required: if this filter is required
* - strategy: the used strategy
* - swagger (optional): additional parameters for the path operation, e.g. 'swagger' => ['description' => 'My Description']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this belongs in the interface...

magarzon pushed a commit to magarzon/core that referenced this pull request Feb 12, 2017
…cription

Extends filter interface description with swagger options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants