-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable OpenAPI definitions to reflect field renaming #49
Enable OpenAPI definitions to reflect field renaming #49
Conversation
@@ -156,6 +156,9 @@ Object { | |||
"format": "uuid", | |||
"type": "string", | |||
}, | |||
"string_value_with_different_wire_name": Object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAPI definition reflects the wire name.
@@ -211,6 +211,11 @@ export function createFixtures(flavor: Flavor): Fixture { | |||
nullable: true, | |||
}) | |||
nullableUUIDValue!: string | null; | |||
|
|||
@IsString({ | |||
name: 'string_value_with_different_wire_name', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted to make this required in testing to ensure that we can always validate that it was converted correctly.
@@ -54,11 +54,13 @@ describe('flavors.basic', () => { | |||
nullableNestedValue: { | |||
nullableStringValue: 'nested', | |||
}, | |||
// NB: This field is not transformed (b/c @Expose() is not included) | |||
string_value_with_different_wire_name: 'value', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice me: I'm assuming the exclusion of expose
on DecoratorOptions
was intentional, meaning that this now adds a new (expected) issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the basic
flavor omits the @Expose
decorator because we used to have a scenario in pod
where that behavior broke things.
039667b
to
4adab0e
Compare
Further support to allow DTO types to retain the expected field naming convention, but expose a different name over its API.
4adab0e
to
750a0e8
Compare
Further support to allow DTO types to retain the expected field naming
convention, but expose a different name over its API.