Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Feature blank fields #364

Merged
merged 4 commits into from
Apr 21, 2022
Merged

Feature blank fields #364

merged 4 commits into from
Apr 21, 2022

Conversation

wadeking98
Copy link
Contributor

Allows the user to leave unrequired fields blank.
Previously any blank field would be left out of the credential request and so aries would throw an error because the credential request wouldn't match the schema.

Resolves: #267

Comment on lines 39 to 48
getSchemaAttrsByID(schema_name: string, schema_version: string): string[] {
const schemas = loadJSON("schemas.json") as SchemaDefinition[]
const filtered = schemas.filter((s) => s.schema_name === schema_name && s.schema_version === schema_version)
let schemaAttributes: string[] = []
if (filtered.length > 0 && filtered[0].attributes) {
schemaAttributes = filtered[0].attributes
}
return schemaAttributes
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would likely be better located in utils/credential-exchange.ts as it is a utility method that might be reused elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change completed

Signed-off-by: wadeking98 <wkingnumber2@gmail.com>
@wadeking98 wadeking98 requested a review from esune April 20, 2022 22:27
@swcurran swcurran merged commit ba7926e into bcgov:main Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support empty values for credential attributes
3 participants