New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need tests for JSON Production and Consumption #26
Comments
@csuwildcat any chance Microsoft / you can help test the representation you fought so hard for us to include :) ? |
The issue was discussed in a meeting on 2021-04-06
View the transcript7.8. Need tests for CBOR/JSON Production and ConsumptionSee github issue did-test-suite#28, did-test-suite#26. Markus Sabadello: those are about sections that don't have tests Daniel Burnett: we were hoping for someone like Jonathan to contribute on the cbor Jonathan Holt: doing my best to get back in the swing with DID contributions Daniel Burnett: daniel can you contribute on the json? the json format in particular was one of the biggest requests from Microsoft on day one of the working group Daniel Buchner: the way we've gone about it I don't know... it's worked perfectly fine working jsonld as json and saying you don't have to resolve contexts Markus Sabadello: i know some people want to treat jsonld and json as equivalent and to include Justin Richer: +1 to what markus was saying
Justin Richer: so if you have the Daniel Buchner: the interesting thing.. it doesn't say anything about must exclude properties... isn't lazy validation accurate? Justin Richer: you need to go one step further because the spec says what to say with unknown properties Daniel Buchner: instead of completely avoiding it or not putting any lines of code that deal with unknown properties, it'll iterate all the properties and have some sort of if that says if you're not in the set.. log it.. do something.. recognise it exists.. if it is in the set do what you're supposed to do? Justin Richer: to be specific what it does is processes the serliazed property based on the type value of the serialized property and puts it into the properties map
Justin Richer: when it comes time to do a production from that ADM if you want to do it into jsonld your jsonld producer needs to be able to make sense of that bad Daniel Buchner: that's a good answer, thank you Daniel Burnett: issue 26 about json... Orie had asked in feb whether you might be able to contribute in writing some tests Daniel Buchner: I'll try to do something about it Daniel Burnett: I think that's it for the test issues |
Reminder that complete tests, including review, auditing, and at least one implementation, are due for this item by the end of this month. |
All JSON Production and Consumption tests have been implemented. Closing. |
6.2.1 JSON Production
The DID document and any DID document data structures expressed by the data model MUST be serialized to the JSON representation according to the following production rules:
2020-12-20T19:17:47Z
.All entries of a DID document MUST be included in the root JSON Object.
When serializing a DID document, a conforming producer MUST specify a media type of
application/did+json
to downstream applications such as described in § 7.1.2 DID Resolution Metadata.6.2.2 JSON Consumption
The DID document and any DID document data structures expressed by a JSON representation MUST be deserialized into the data model according to the following consumption rules:
If media type information is available to a conforming consumer and the media type value is
application/did+json
, then the data structure being consumed is a DID document, and the root element MUST be a JSON Object where all members of the object are entries of the DID document.A conforming consumer for a JSON representation that is consuming a DID document with a root element that is not a JSON Object MUST report an error.
The text was updated successfully, but these errors were encountered: