Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Cannot use schema properties with capital letters #227

Open
TimoGlastra opened this issue Jul 27, 2021 · 3 comments
Open

Cannot use schema properties with capital letters #227

TimoGlastra opened this issue Jul 27, 2021 · 3 comments

Comments

@TimoGlastra
Copy link
Contributor

When you create a schema with attribute names that contain capital letters it won't let you issue a credential.

The following error is thrown:

animo-faber-acapy_1  |     f"Preview attributes {preview_attrs} "
animo-faber-acapy_1  | aries_cloudagent.protocols.issue_credential.v1_0.manager.CredentialManagerError: Preview attributes {'age', 'name'} mismatch corresponding schema attributes {'Name', 'Age'}

It seems like Name and Age are transformed to name and age, making ACA-Py error out.

@dbluhm
Copy link
Contributor

dbluhm commented Aug 2, 2021

I've run into this asymmetry in canonization of schema and credential attributes before but have not been able to discover the root cause yet. I've asked in a couple of ACA-Py issues before but each time has left me confused. From the toolbox/plugin perspective, I believe we're more or less depending on ACA-Py for the bulk of the logic for both schema creation and credential issuance. My "solution" so far has been to use all lower case and underscore instead of spaces. Would you consider this format being enforced on schema creation by the toolbox to be an acceptable fix?

@TimoGlastra
Copy link
Contributor Author

TimoGlastra commented Aug 2, 2021

Would you consider this format being enforced on schema creation by the toolbox to be an acceptable fix?

I'd say no :-). We're display the schema name in mobile wallets, so would like to have it capitalized.

But if it's an ACA-Py issue, rather than a toolbox issue I'll take a look at ACA-Py. Just assumed this was done by the toolbox.

If I create a schema in the rest api of ACA-Py it doesn't seem to make the attributes lower case (Run https://faber.agent.animo.id/api/doc#/schema/get_schemas__schema_id_ with schema id Vv7QMiUXbDpih8UScbGU2t:2:prefs2222:1.0)

@swcurran
Copy link

swcurran commented Aug 3, 2021

A couple of thoughts on this. It might be an Indy-SDK issue -- I seem to remember @sklump talking about that. Within ACA-Py, I'm pretty sure Stephen worked on this, and he is not available for this, so someone else will have to take a look.

The better answer in the long run is a way to have a separation between the internal name and the presentation. This is going to be necessary for localization/supporting multiple languages. The Overlays model (now in ToIP) is one technique that could be used. It's a difficult challenge, and I'm not sure the progress that has been made on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants