Serializing a collection of objects with top level meta object
See original GitHub issueJSON API allows adding a top level meta object: http://jsonapi.org/format/#document-meta
{
"meta": {
"copyright": "Copyright 2015 Example Corp.",
"authors": [
"Yehuda Katz",
"Steve Klabnik",
"Dan Gebhardt",
"Tyler Kellen"
]
},
"data": {
// ...
}
}
Is there a way to do it in marshmallow-jsonapi
? It seems like it’s only allows to have a meta
in Resource Objects.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
How to serialize top level objects with Json.NET as objects ...
To serialize and making use of the custom resolver you would: var serializer = new JsonSerializer { Formatting = Formatting.
Read more >Serialization Guide - Json.NET
The Json.NET serializer can serialize a wide variety of .NET objects. This guide looks at how it works, first at a high level...
Read more >Serializing Django objects
The whole collection of objects that is either serialized or deserialized is represented by a <django-objects> -tag which contains multiple <object> -elements.
Read more >JSON serialization - Immutables
Generic parameters are supported when some upper level JSON document object specify actual type parameters, so nested document value objects that are ...
Read more >Quickstart — marshmallow-jsonapi 0.24.0 documentation
Objects will be serialized to JSON API documents with primary data. ... field is used to serialize the meta object within a document's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@scottwernervt unfortunately this isn’t a solution to the problem, as
meta
field should be a top-level property so it should be:Instead of:
I was playing with doing that, however I found that deserializing the data need a bunch of changes to
_META_LOAD_FROM
logic. It wasn’t designed with the idea of two Meta fields.Might want to continue this conversation in #107