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

Enable item route on collection subresources #1875

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Apr 18, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets api-platform/api-platform#644 kinda #1875
License MIT
Doc PR na

Say you had a subresource on a collection:

<?php
namespace App;
use App\Bar;

/**
 * @ApiResource
 */
class Foo {
  /**
   * @ApiSubresource
   * @var Bar[]
   */
  public $bars;
}

this was declaring the following routes:

/bars
/foo
/foo/{id}/bars

This patch enables subresource item operations:

/bars
/foo
/foo/{id}/bars
/foo/{id}/bars/{barId}

Note: I'll work on the subresource documentation soon it lacks lot of things :).

@soyuka soyuka force-pushed the subresource-item branch from 186c30a to ba66589 Compare April 19, 2018 07:56
@soyuka soyuka force-pushed the subresource-item branch from ba66589 to 933a650 Compare April 19, 2018 08:47
@soyuka soyuka mentioned this pull request Apr 19, 2018
@dunglas dunglas merged commit 2454ec1 into api-platform:2.2 Apr 20, 2018
@dunglas
Copy link
Member

dunglas commented Apr 20, 2018

Thanks @soyuka

@soyuka soyuka deleted the subresource-item branch April 20, 2018 09:01
teohhanhui pushed a commit to teohhanhui/api-platform-core that referenced this pull request May 2, 2018
Enable item route on collection subresources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants