Closed gnapse closed 5 years ago
Yep, this should definitely be in the types. I'll see if I can find time to address this in the next couple of weeks, unless you beat me to it!
I can do it right now. I just have a couple of questions: do you agree the resolution should involve adding meta?: MetaObject
to DocBase
? And if so, then what's the point of DocWithMeta
?
Is your feature request related to a problem? Please describe.
I regularly need to process jsonapi responses that may or may not include the top level
meta
key. However,DocWithData
does not include the optionalmeta
key.Describe the solution you'd like
Add
meta?: MetaObject
toDocWithData
. Or better yet, toDocBase
.I may be missing something if you intentionally did not include it in that way, and decided to provide
DocWithMeta
as a separate entity, but the more I read the specification,meta
can be found in any valid jsonapi response, or at least in responses withdata
, as seen here.Describe alternatives you've considered
I was thinking of declaring a type
DocWithData & DocWithMeta
, but that does not express thatmeta
is optional. I'm left with declaring something like this:But then again I'd have to replicate the above for
SingleResourceDoc
andCollectionResourceDoc
.If this is accepted, I'm more than happy to work on a PR myself.