Sitelet https://github.com/confluentinc/confluent-kafka-javascript/pull/482
Skip to content

DGS-24227 Preserve custom subjectNameStrategy in serde constructors - #482

Merged
Robert Yokota (rayokota) merged 2 commits into
masterfrom
DGS-24227
May 7, 2026
Merged

Robert Yokota (rayokota) merged 2 commits into
masterfrom
DGS-24227

Conversation

@rayokota

Copy link
Copy Markdown
Member

Please prefix all TypeScript pull-requests with [Typescript]

What

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

Copilot AI review requested due to automatic review settings May 7, 2026 20:20
@rayokota
Robert Yokota (rayokota) requested review from a team as code owners May 7, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-supplied subjectNameStrategy when subjectNameStrategyType is not explicitly set.
  • Add a JSON serde test validating that a user-provided subjectNameStrategy is 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
}

@naxinf Naxin Fang (naxinf) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! nit: would be great to link the jira ticket so it can be tracked and closed

@sonarqube-confluent

Copy link
Copy Markdown

@rayokota
Robert Yokota (rayokota) merged commit 6ef5fd2 into master May 7, 2026
3 checks passed
@rayokota
Robert Yokota (rayokota) deleted the DGS-24227 branch May 7, 2026 20:48
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