question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'extra' field in 'registered_meta' 'summary' object is serialized as an object and as an array.

See original GitHub issue

Summary

The registered_meta field carries an object named summary. The summary object carries a field named extra. I have two registrations; each registration serializes the extra field differently.

Both registrations would have been made by the UI (not the API). Note that 5nua2 was registered some time after tgzhk (August vs March), so maybe some change in the underlying code base is responsible for this?

Steps

  1. Look at registered_meta for tgzhk (note: using version 2.2 of the API)- extra is serialized as an empty object:
"registered_meta": {
                "summary": {
                    "value": "Test registration.",
                    "comments": [],
                    "extra": {}
                }
            }
  1. Look at registered_meta for 5nua2 (note: using version 2.2 of the API)- extra is serialized as an empty array:
"registered_meta": {
                "summary": {
                    "value": "test",
                    "comments": [],
                    "extra": []
                }
            }

Expected

I would expect the type of the extra field to be consistent. That is, for all registered_meta instances, all extra fields would either be an array or an object, but not both.

This is all the more curious because the values for extra in this case are empty!

Actual

In actuality, it appears that the extra, at least when part of registered_meta, can be arbitrarily an object or an array, which proves problematic when deserializing the JSON to Java objects.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
felliottcommented, Feb 15, 2017

Hey @emetsger, @msuhovec,

We’ve got a ticket for this issue. It’ll probably in the second post-Django release.

Cheers, @felliott

0reactions
brianjgeigercommented, Mar 17, 2017

Also, the field should always be a list. If there’s anything in the list, currently that’s going to be file metadata.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add extra fields to an Object during Jackson's json ...
What is the best way of doing that, which doesn't involve creation of custom serializer class, which will take care of serializing of...
Read more >
How can I generate arrays [...] to serialize an object? I want to ...
Assuming your question is how to generate arrays [...] using this coding pattern, the answer is to use new List<Object> for those e.g.:...
Read more >
Serialization Attributes - Json.NET
JsonPropertyAttribute - Placed on fields and properties to control how they should be serialized as a property in a JSON object.
Read more >
How to serialize properties of derived classes with System ...
Learn how to serialize polymorphic objects while serializing to and deserializing from JSON in .NET.
Read more >
Jackson – Decide What Fields Get Serialized/Deserialized
How to control which fields get serialized/deserialized by Jackson and ... mapper = new ObjectMapper(); MyDtoAccessLevel dtoObject = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found