Skip to content

Document input/output resource attribute#646

Merged
soyuka merged 1 commit intoapi-platform:masterfrom
soyuka:doc-io
Nov 15, 2018
Merged

Document input/output resource attribute#646
soyuka merged 1 commit intoapi-platform:masterfrom
soyuka:doc-io

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Nov 7, 2018

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

@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