nuts-foundation / nuts-node

The reference implementation of the Nuts specification. A decentralized identity network based on the w3c ssi concepts with practical functionality for the healthcare domain.
https://nuts-foundation.gitbook.io
GNU General Public License v3.0
25 stars 16 forks source link

Chore: what to do with api/ssi_types.go #2425

Open reinkrul opened 1 year ago

reinkrul commented 1 year ago

The generated types in the file appear unused, the package is named differently from the directory.

@gerardsn do you know what the intended purpose was of this file?

gerardsn commented 1 year ago

Objects like VerfiableCredential, DID, DIDDocument, VerifiablePresentation, etc... were used/redefined in multiple OAPI specs (VDR, VCR, didman, ...). The definitions started to diverge a bit, and incorrect definitions were not always fixed on all specs. By using a single reference (/docs/common/ssi_types.yaml) it was easier to get and keep them consistent.

Last time I checked the externally defined objects are (partially) broken though. Or at least in combination with the code generator, since generation fails for objects in this file. It works because we currently alias all types to our own defined structs. The ssi_types.go exists so that ssi_types_test.go can confirm the spec and our own structs match.