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

Feature request: InfoDocument support #87

Open
Doqnach opened this issue Jul 16, 2019 · 1 comment
Open

Feature request: InfoDocument support #87

Doqnach opened this issue Jul 16, 2019 · 1 comment

Comments

@Doqnach
Copy link

Doqnach commented Jul 16, 2019

I am looking for a way to define a pure "info" document. Easiest would be to create a base class that implements DocumentInterface, but all the WoohooLabs\Yin\JsonApi\Response\Responder::ok<...>() methods require a ResourceDocumentInterface.

So this left me with two options: create an InfoDocument that implemented ResourceDocumentInterface and somehow work around the methods that you have to implement, or have a method in WoohooLabs\Yin\JsonApi\Response\Responder that accept an InfoDocument extends DocumentInterface, but that also gives of course problems...
Because several methods in ResourceDocumentInterface are marked as @internal, this also gives warnings (at least in Symfony).

So for now I just went for option 1 (create an InfoDocument implements ResourceDocumentInterface in the WoohooLabs\Yin\JsonApi\Schema\Document namespace) but maybe someone else has a better idea?

I feel this is something that Yin should support to be honest since it's a very legit JSON:API document type.

https://gist.github.com/Doqnach/b0a000e4f238e91a9085fc7ba57a2719

@Doqnach Doqnach changed the title InfoDocument/MetaDocument implementing DocumentInterface Feature request: InfoDocument support Jul 16, 2019
@kocsismate
Copy link
Member

Hi @Doqnach,

Sorry, I am totally out of bandwidth this summer. :( I'll try to read through this feature request and the other question you had as soon as I'll have some spare time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants