Skip to content

feat: use generated models for credential endpoints#83

Open
Sotatek-Patrick-Vu wants to merge 36 commits intomainfrom
feat/GeneratedCredentialModels
Open

feat: use generated models for credential endpoints#83
Sotatek-Patrick-Vu wants to merge 36 commits intomainfrom
feat/GeneratedCredentialModels

Conversation

@Sotatek-Patrick-Vu
Copy link
Collaborator

@Sotatek-Patrick-Vu Sotatek-Patrick-Vu commented Mar 11, 2026

Continuation of #79 but for credentials.

Sotatek-DucPhung and others added 30 commits March 4, 2026 14:49
- Introduced IdentifierModelConverter for converting generated KERIA models to domain models.
- Added IdentifierPayloadMapper to build request payloads for identifier endpoints.
- Updated Identifier class to utilize GeneratedModelMapper for JSON parsing.
- Modified IdentifierListResponse to use a list of Identifier objects instead of generic Object.
- Implemented KeyStateRecordDeserializer to handle deserialization of KeyStateRecord.
- Centralized Jackson configuration in GeneratedModelConfig for better management of generated models.
- Updated various tests to reflect changes in identifier handling and ensure consistency.
@iFergal iFergal changed the title Apply generated models for credential part feat: use generated models for credential endpoints Mar 11, 2026
return iss;
}

private static Object tryParseJsonObject(String s) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This has highlighted a big problem. Some fields in ACDCs can be compacted and replaced with a SAID, this is what keripy provides in its fielddom. We are overriding a with ACDCAttributes. So we haven't covered the compacted case, but KERIA will never provide the compacted version in its current version.

I think we should write dataclasses in KERIA for e and r and override ACDC with this.

Then when we re-generate, we will have the correct objects and not strings.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we fix this, I think we will be able to directly use Utils.toMap for now rather than having these as it'll be in the correct format.

if (etNode != null && !etNode.isNull()) {
String et = etNode.asText();
switch (et) {
case "bis", "brv" -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

worth investigating if added a discriminator to the openapi spec will resolve these issues rather than hand rolling imo

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 this pull request may close these issues.

3 participants