CardanoSolutions / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano

Home Page:https://ogmios.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid metadata json format

KtorZ opened this issue · comments

Discussed in #336

Originally posted by mkazlauskas October 5, 2023

What Git revision / release tag are you using?

v6.0.0 (rc2)

Do you use any client SDK? If yes, which one?

TypeScript

Describe what the problem is?

Transaction metadata map is being returned as an array of objects that have a single key-value pair. e.g. this nft metadata is being returned as

[
  { "e2bab64ca481afc5a695b7db22fd0a7df4bf930158dfa652fb337999": [...] },
  { "version": "1.0" }
]

What should be the expected behavior?

Map should be returned as single json object that has multiple key-value pairs. e.g.

{
  "e2bab64ca481afc5a695b7db22fd0a7df4bf930158dfa652fb337999": {...},
  "version": "1.0"
}

This would make it easier to use, as well as make it possible differentiate between arrays and maps (array -> array, map -> object)

If applicable, what are the logs from the server around the occurence of the problem?

No response

Note: sorry I used a 'Bug' template again, couldn't remove Bug label.

@mkazlauskas sorry for the back-and-forth, I thought this was a feature request but it is actually a bug. Metadata should be serialized as Objects in this situation.