Skip to content
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

Explicitly state JSON Object Types #123

Closed
David-Chadwick opened this issue Mar 1, 2018 · 4 comments
Closed

Explicitly state JSON Object Types #123

David-Chadwick opened this issue Mar 1, 2018 · 4 comments
Assignees

Comments

@David-Chadwick
Copy link
Contributor

In all the examples, the JSON object is not specified. One has to look inside the type parameter to find out what sort of JSON object it is. However, when the object is embedded in another object e.g. credential inside profile, then the object type is specified. I therefore suggest that each object should starts by stating what type of object it is. Thus Example 1 would become

credential: {
  "id": "http://dmv.example.gov/credentials/3732",
  "type": ["Credential", "ProofOfAgeCredential"],
  "issuer": "https://dmv.example.gov/issuers/14",
  "issued": "2010-01-01T19:73:24Z",
  "claim": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "ageOver": 21
  },
  "proof": { ... }
} 

This would have the added advantage that the first value from the type property can be omitted.

and example 17 would become (removing any reference to JSON-LD)

Example 17: A simple verifiable profile in JSON Format

profile: {
  "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
  "credential": [{
    "id": "http://dmv.example.gov/credentials/3732",
    "type": ["ProofOfAgeCredential"],
    "issuer": "https://dmv.example.gov/issuers/14",
    "issued": "2010-01-01T19:73:24Z",
    "claim": {
      "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
      "ageOver": 21
    },
.....
@gkellogg gkellogg self-assigned this Mar 13, 2018
@BigBlueHat
Copy link
Member

@David-Chadwick adding that to the example content would make the JSON invalid, so I'd be 👎 on adding credential: or profile: to either of the examples (or any of the others).

Example code gets copy/pasted frequently, so adding anything that would make it invalid is inhibitive.

@David-Chadwick
Copy link
Contributor Author

@BigBlueHat. Its not invalid JSON. It might be invalid JSON-LD. However, an alternative solution has been proposed in #149

@msporny
Copy link
Member

msporny commented Jul 10, 2018

We addressed this issue in PR #189 ... @David-Chadwick can we close this issue now that the PR is in the core spec?

@msporny
Copy link
Member

msporny commented Jul 19, 2018

Closing, as I believe we've addressed this issue in PR #189. Re-open if we haven't.

@msporny msporny closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants