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

Types for TS is not following standards, specifically DIDDoc #91

Closed
vongohren opened this issue Nov 9, 2022 · 3 comments · Fixed by #99
Closed

Types for TS is not following standards, specifically DIDDoc #91

vongohren opened this issue Nov 9, 2022 · 3 comments · Fixed by #99
Assignees

Comments

@vongohren
Copy link

vongohren commented Nov 9, 2022

What

Give a brief description of the objective of this issue. What needs to be discussed?
The current produced types for TS is not following standards of the spec.
I just touched upon the DIDDoc type and that has false things such as:

    /**
     * DID for the given DID Doc
     */
    did: string,

This should be id - https://www.w3.org/TR/did-core/#did-document-properties

    /**
     * DID URLs of verification methods used for key agreement.
     * See https://www.w3.org/TR/did-core/#verification-methods.
     */
    key_agreements: Array<string>,

this should be keyAgreements - https://www.w3.org/TR/did-core/#did-document-properties

So I dont know how literal to the spec one should be, but the resolved documents will not be of proper attributes if these types are correct.

Why

Explain why you think this issue needs to be addressed and why it should be addressed in this repo.

Because the produced type is not correct to what a did doc should be if you want to work with other libraries.

Success Criteria

Explain what actions or decisions need to be completed to close this issue.

  • Using a task list here can be helpful to track progress.
    Update the production of types to produce proper TS types

Anything else

Include links to any examples, research or code that support this issue.
I dont know how this works with a wasmbinding and the rust magic, but I assume it transpiles the attribute values in the rust code directly to these names. And then I can understand things become a bit wonky.
Maybe one can define in some config somewhere to transpile to the right attributes?

Before submitting:

  • Add appropriate labels for 'type:' and 'related to:'
  • Add an assignee if you want to direct this issue at a particular individual
@dkulic
Copy link
Contributor

dkulic commented Nov 9, 2022

Hi all, me and @yvgny are planning to fix this issue. Please be patient, we will do it.

@vongohren
Copy link
Author

Great stuff! This is quite bad to use acctually becaues I have to write a "converter" if im going to follow your types.

And I assume your types are important as the data structure further down has to follow this structure.

So its great if the different types are updated to the standard, as did service attribute also seems out of date.

@yvgny
Copy link
Contributor

yvgny commented Dec 1, 2022

Hi @vongohren, the main branch is now updated with types aligned to the standards. Let me know if you still find any discrepancies. Once it's stabilized we can issue a new release of the lib too.

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

Successfully merging a pull request may close this issue.

3 participants