Skip to content

add maxDepth on subresources doc #351

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

Merged
merged 2 commits into from
Nov 28, 2017
Merged

add maxDepth on subresources doc #351

merged 2 commits into from
Nov 28, 2017

Conversation

Nightbr
Copy link
Contributor

@Nightbr Nightbr commented Nov 24, 2017

Related to this PR api-platform/core#1520

Add maxDepth parameter on ApiSubresource in order to control the depth of subresources.

@@ -344,6 +344,49 @@ Note that the operation name, here `api_questions_answer_get_subresource`, is th
It'll be automatically set to `$resources_$subresource(s)_get_subresource`. To find the correct operation name you
may use `bin/console debug:router`.

Add to that, you can control depth of subresources with the parameter `maxDepth`. For example, if `Answer` entity also have subresource such as `comments`, you would like to not generate the route `api/questions/{id}/answers/{id}/comments`. You can do this by adding the parameter maxDepth in ApiSubresource annotation or yml/xml file configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a new title:

### Control the depth of subresources

A bit of language change proposal:

- Add to that,
- you would like to not generate the route `...`
+ and you don't want the route `...` to be generated

@sroze
Copy link
Contributor

sroze commented Nov 28, 2017

Feature PR is merged ✅

@soyuka soyuka merged commit c25162b into api-platform:2.1 Nov 28, 2017
@soyuka
Copy link
Member

soyuka commented Nov 28, 2017

Thanks @Nightbr !

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