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

Solution for production of representation specific properties #662

Closed
OR13 opened this issue Feb 17, 2021 · 2 comments
Closed

Solution for production of representation specific properties #662

OR13 opened this issue Feb 17, 2021 · 2 comments
Assignees

Comments

@OR13
Copy link
Contributor

OR13 commented Feb 17, 2021

instead of thinking about production as a function of the ADM, let us think of it as a function of the ADM and the representation....

So for example:

const produce = (adm: infra<map>, representation: infra<map>) => {
  let didDocument = {...adm, ...representation};
  return serialize(didDocument);
}

the production rules can then apply normative requirements to both the adm and the representation, and their combination....

consumption remains the same, no need for "special buckets" or dangerous complexity.... if you consume JSON-LD and produce JSON, @context is preserved... if you consume JSON and produce JSON-LD you add the context during production and it never gets added to the ADM...

The same would apply to any representation specific properties... they are ALWAYS preserved on consumption, and ALWAYS required as a second argument of production.

@msporny
Copy link
Member

msporny commented Feb 17, 2021

Doh, didn't see this before creating #664 -- the issues are related, don't know if you agree that overlap is 100%... you make the call -- do you want to merge, or keep these separate? I'd prefer to merge and have the entire discussion in one thread.

@OR13
Copy link
Contributor Author

OR13 commented Feb 17, 2021

Also related: #654 (comment)

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

2 participants