feat: use generated models for credential endpoints#83
feat: use generated models for credential endpoints#83Sotatek-Patrick-Vu wants to merge 36 commits intomainfrom
Conversation
- 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.
…ds and using direct calls
…hods for consistency
…onsistency and clarity
| return iss; | ||
| } | ||
|
|
||
| private static Object tryParseJsonObject(String s) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" -> { |
There was a problem hiding this comment.
worth investigating if added a discriminator to the openapi spec will resolve these issues rather than hand rolling imo
Continuation of #79 but for credentials.