DGS-24227 Preserve custom subjectNameStrategy in serde constructors - #482
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures that when a user provides a custom subjectNameStrategy function in SerDe configs, it isn’t overwritten by the default built-in strategy selection during SerDe construction/configuration.
Changes:
- Update
Serde.configureSubjectNameStrategy()to preserve a user-suppliedsubjectNameStrategywhensubjectNameStrategyTypeis not explicitly set. - Add a JSON serde test validating that a user-provided
subjectNameStrategyis invoked and used for schema lookup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
schemaregistry/serde/serde.ts |
Preserve custom subjectNameStrategy when no explicit subjectNameStrategyType is provided. |
schemaregistry/test/serde/json.spec.ts |
Add coverage to ensure custom subject naming strategy functions are invoked and honored. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+252
to
+256
| // If the user supplied a custom subjectNameStrategy function and didn't | ||
| // explicitly request a built-in strategy type, preserve their function. | ||
| if (strategyType == null && this.conf.subjectNameStrategy != null) { | ||
| return | ||
| } |
Naxin Fang (naxinf)
approved these changes
May 7, 2026
Naxin Fang (naxinf)
left a comment
Member
There was a problem hiding this comment.
LGTM! nit: would be great to link the jira ticket so it can be tracked and closed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Please prefix all TypeScript pull-requests with
[Typescript]What
Checklist
References
JIRA:
Test & Review
Open questions / Follow-ups