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

Document input/output resource attribute #646

Merged
merged 1 commit into from
Nov 15, 2018
Merged

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Nov 7, 2018

core/dto.md Outdated Show resolved Hide resolved
core/dto.md Outdated
use App\Dto\Output;

/**
* @ApiResource(attributes={
Copy link
Member

Choose a reason for hiding this comment

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

You could use the shortcuts inputClass and outputClass directly

core/dto.md Outdated

/**
* {@inheritdoc}
*/
Copy link
Member

Choose a reason for hiding this comment

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

Could be remove in the example

core/dto.md Outdated
use App\Dto\Input;
use App\Dto\Output;

class InputDataPersister implements DataPersisterInterface
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class InputDataPersister implements DataPersisterInterface
final class InputDataPersister implements DataPersisterInterface

core/dto.md Show resolved Hide resolved
@dunglas
Copy link
Member

dunglas commented Nov 9, 2018

Shouldn't we remove the previous sections in the same file (https://api-platform.com/docs/core/dto/#how-to-use-a-dto-for-writing).
Using your solution is much better and cleaner, so we should recommend always using it.

@soyuka
Copy link
Member Author

soyuka commented Nov 9, 2018

Yeah we should def remove the previous sections, but we need swagger support first :|.
I'll add a deprecation sentence.

@soyuka soyuka merged commit ad5a148 into api-platform:master Nov 15, 2018
@soyuka soyuka deleted the doc-io branch November 15, 2018 17:01
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