feat(common): allow injecting global serializer options - #16966
Conversation
|
Transforming |
Coverage Report for CI Build 31Coverage remained the same at 89.903%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
馃挍 - Coveralls |
|
Hi thanks for the PR @Nosfistis! |
|
btw this is not a 'fix' but a 'feat' |
|
@micalevisk Indeed, it is a typo. |
1959b03 to
8933e9e
Compare
|
I have amended the commit message, if that was the blocking part. Unless the whole reasoning of this PR is out of scope, let's discuss what else is needed. |
There was a problem hiding this comment.
Pull request overview
Enables global dependency-injection of ClassSerializerInterceptor default options by turning ClassSerializerInterceptorOptions into a runtime DI token (a class), addressing the limitation described in #16963.
Changes:
- Replaced
ClassSerializerInterceptorOptionsfrom a type-only interface with a runtime-exported class to support DI. - Added
ClassTransformOptions-compatible option properties ontoClassSerializerInterceptorOptionsfor consumer typing.
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| export class ClassSerializerInterceptorOptions implements ClassTransformOptions { | ||
| transformerPackage?: TransformerPackage; | ||
| strategy?: 'excludeAll' | 'exposeAll'; | ||
| groups?: string[]; | ||
| version?: number; | ||
| excludePrefixes?: string[]; | ||
| ignoreDecorators?: boolean; | ||
| targetMaps?: any[]; | ||
| enableCircularCheck?: boolean; | ||
| enableImplicitConversion?: boolean; | ||
| excludeExtraneousValues?: boolean; | ||
| exposeDefaultValues?: boolean; | ||
| exposeUnsetFields?: boolean; | ||
| } |
| * @publicApi | ||
| */ | ||
| export interface ClassSerializerInterceptorOptions extends ClassTransformOptions { | ||
| export class ClassSerializerInterceptorOptions implements ClassTransformOptions { |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #16963
What is the new behavior?
It is now possible to use
ClassSerializerInterceptorOptionsto inject options forclass-serializerinterceptor globally.Does this PR introduce a breaking change?
Other information