Skip to content

fix: [PromptRegistry] oneOf deserialization for proper support of both template types#789

Open
n-o-u-r-h-a-n wants to merge 3 commits intomainfrom
improve-prompt-registry-tests
Open

fix: [PromptRegistry] oneOf deserialization for proper support of both template types#789
n-o-u-r-h-a-n wants to merge 3 commits intomainfrom
improve-prompt-registry-tests

Conversation

@n-o-u-r-h-a-n
Copy link
Contributor

@n-o-u-r-h-a-n n-o-u-r-h-a-n commented Mar 18, 2026

Context

AI/ai-sdk-java-backlog#346.

Comprehensive unit test coverage was added as the prompt-registry module was initially developed as a PoC.

Feature scope:

  • PromptTemplate oneOf deserialization now properly supports both template types.
  • parsePromptTemplateByNameVersion was identified as a hot path and tested.
    • coverage percentages have been increased.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

private static class JacksonMixin {
@JsonTypeInfo(use = JsonTypeInfo.Id.NONE)
@JsonDeserialize(as = SingleChatTemplate.class)
@JsonDeserialize(using = PromptTemplateDeserializer.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

(Major)

I assume this is a breaking change. Or it is a fix. Anyway it requires a dedicated PR with semantic title: fix: [PromptRegistry] ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is a fix to address the 2nd bullet point of the expected state :
image

So, shall I create a separate PR now with the 2nd point alone?

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively just rename this PR, and keep everything as is.

LGTM

@n-o-u-r-h-a-n n-o-u-r-h-a-n changed the title chore: [PromptRegistry] improve test coverage fix: [PromptRegistry] oneOf deserialization for proper support of both template types Mar 18, 2026
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.

2 participants