aries-toolbox icon indicating copy to clipboard operation
aries-toolbox copied to clipboard

Cannot use schema properties with capital letters

Open TimoGlastra opened this issue 3 years ago • 3 comments

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.

TimoGlastra avatar Jul 27 '21 20:07 TimoGlastra

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?

dbluhm avatar Aug 02 '21 15:08 dbluhm

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)

TimoGlastra avatar Aug 02 '21 16:08 TimoGlastra

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.

swcurran avatar Aug 03 '21 14:08 swcurran