Duplicate JSON Keys in request
mkhraisha opened this issue · comments
by duplicate keys I mean:
{
"a": "test string 1",
"a": "test string 2"
}
What should the issuer do when presented a credential to issue with duplicate keys?
JSON spec is silent on this: https://www.rfc-editor.org/rfc/rfc8259#section-4
JSON-LD spec says no duplicate keys: https://www.w3.org/TR/json-ld11/#json-ld-grammar
- return a 400 bad request
- use the second value, i.e. "test string 2"
Most JSON/JSON-LD libraries use option 2 when processing JSON input
Request for a conformance test?
Test should throw 400 on duplicate keys.
Make the test for a mandatory field like issuer
.
I believe most json processing libraries by default go with option 2, and silently drop the first term.
Body-parser etc.
Ping @brownoxford
Will autoclose once relevant PR is merged