You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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 theWoohooLabs\Yin\JsonApi\Response\Responder::ok<...>()
methods require aResourceDocumentInterface
.So this left me with two options: create an
InfoDocument
that implementedResourceDocumentInterface
and somehow work around the methods that you have to implement, or have a method inWoohooLabs\Yin\JsonApi\Response\Responder
that accept anInfoDocument 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 theWoohooLabs\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
The text was updated successfully, but these errors were encountered: