-
Notifications
You must be signed in to change notification settings - Fork 507
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
perf: skip validation on default value #1708
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,7 +325,7 @@ describe('ValidationService', () => { | |
describe('Param validate', () => { | ||
it('should apply defaults for optional properties', () => { | ||
const value = undefined; | ||
const propertySchema: TsoaRoute.PropertySchema = { dataType: 'integer', default: '666', required: false, validators: {} }; | ||
const propertySchema: TsoaRoute.PropertySchema = { dataType: 'integer', default: 666, required: false, validators: {} }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you revert these changes? At least while we don't check/fix when creating the metadata for validation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If revert it, test fails... it's ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem then is that this is the schema with the default being a string is what we would generate "in the real world". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah ok, so this PR can't work! |
||
const result = new ValidationService( | ||
{}, | ||
{ | ||
|
@@ -351,7 +351,7 @@ describe('ValidationService', () => { | |
|
||
it('should apply defaults for required properties', () => { | ||
const value = undefined; | ||
const propertySchema: TsoaRoute.PropertySchema = { dataType: 'integer', default: '666', required: true, validators: {} }; | ||
const propertySchema: TsoaRoute.PropertySchema = { dataType: 'integer', default: 666, required: true, validators: {} }; | ||
const result = new ValidationService( | ||
{}, | ||
{ | ||
|
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.