-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
fix(typescript-fetch): generate validationAttributes when withoutRuntimeChecks=true #23107
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
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 |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| {{#validationAttributes}} | ||
|
Member
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. does this change require any import changes in any of the mustache files?
Contributor
Author
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. no it should be ok, since the map is included in the |
||
|
|
||
| export const {{classname}}PropertyValidationAttributesMap: { | ||
| [property: string]: { | ||
| maxLength?: number, | ||
| minLength?: number, | ||
| pattern?: string, | ||
| maximum?: number, | ||
| exclusiveMaximum?: boolean, | ||
| minimum?: number, | ||
| exclusiveMinimum?: boolean, | ||
| multipleOf?: number, | ||
| maxItems?: number, | ||
| minItems?: number, | ||
| uniqueItems?: boolean | ||
| } | ||
| } = { | ||
| {{#vars}} | ||
| {{#hasValidation}} | ||
| {{name}}: { | ||
| {{#maxLength}} | ||
| maxLength: {{maxLength}}, | ||
| {{/maxLength}} | ||
| {{#minLength}} | ||
| minLength: {{minLength}}, | ||
| {{/minLength}} | ||
| {{#pattern}} | ||
| pattern: '{{pattern}}', | ||
| {{/pattern}} | ||
| {{#maximum}} | ||
| maximum: {{maximum}}, | ||
| exclusiveMaximum: {{exclusiveMaximum}}, | ||
| {{/maximum}} | ||
| {{#minimum}} | ||
| minimum: {{minimum}}, | ||
| exclusiveMinimum: {{exclusiveMinimum}}, | ||
| {{/minimum}} | ||
| {{#multipleOf}} | ||
| multipleOf: {{multipleOf}}, | ||
| {{/multipleOf}} | ||
| {{#maxItems}} | ||
| maxItems: {{maxItems}}, | ||
| {{/maxItems}} | ||
| {{#minItems}} | ||
| minItems: {{minItems}}, | ||
| {{/minItems}} | ||
| {{#isArray}} | ||
| uniqueItems: {{uniqueItems}}, | ||
| {{/isArray}} | ||
| }, | ||
| {{/hasValidation}} | ||
| {{/vars}} | ||
| } | ||
| {{#isAdditionalPropertiesTrue}} | ||
|
|
||
| export const {{classname}}AdditionalPropertiesValidationAttributes: { maxProperties?: number, minProperties?: number } = { | ||
| {{#maxProperties}} | ||
| maxProperties: {{maxProperties}}, | ||
| {{/maxProperties}} | ||
| {{#minProperties}} | ||
| minProperties: {{minProperties}}, | ||
| {{/minProperties}} | ||
| } | ||
| {{/isAdditionalPropertiesTrue}} | ||
| {{/validationAttributes}} | ||
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.
is this change backwards compatible? maybe people imported this map from this file?
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.
It should be backwards compatible, this template includes the
modelGenericInterfaces.mustache(which renders this map) as a partial, so this map will still be rendered in this file.