Skip to content

Commit 7125ef4

Browse files
authored
Typescript: fix: add paramPropertyNaming (#9546)
Model naming conforms to the property: modelPropertyNaming, however the parameter naming scheme is currently hardcoded to camelcase. Since the parameter names are closely tied to the model properties names, is maybe desirable to use a similar naming approach. The toParamName cannot directly use the paramPropertyNaming since that will cause issues with current generated code, since the modelPropertyNaming currently defaults to "original" A new property has been created to override this behavior, named "paramPropertyNaming", and its default is set to "camelcase".
1 parent 64ee3fe commit 7125ef4

27 files changed

+105
-1
lines changed

docs/generators/javascript-flowtyped.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1818
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
1919
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2020
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
21+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2122
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2223
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2324
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

docs/generators/typescript-angular.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2424
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
2525
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2626
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
27+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2728
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2829
|providedIn|Use this property to provide Injectables in wanted level (it is only valid in angular version greater or equal to 9.0.0).|<dl><dt>**root**</dt><dd>The application-level injector in most apps.</dd><dt>**none**</dt><dd>No providedIn (same as providedInRoot=false)</dd><dt>**any**</dt><dd>Provides a unique instance in each lazy loaded module while all eagerly loaded modules share one instance.</dd><dt>**platform**</dt><dd>A special singleton platform injector shared by all applications on the page.</dd></dl>|root|
2930
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0). IMPORTANT: Deprecated for angular version greater or equal to 9.0.0, use **providedIn** instead.| |false|

docs/generators/typescript-angularjs-deprecated.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1515
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
1616
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original|
1717
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
18+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
1819
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
1920
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
2021
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|

docs/generators/typescript-aurelia.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1717
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
1818
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
1919
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
20+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2021
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2122
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2223
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

docs/generators/typescript-axios.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1818
|npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null|
1919
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2020
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
21+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2122
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2223
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2324
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

docs/generators/typescript-fetch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1818
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
1919
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2020
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
21+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2122
|prefixParameterInterfaces|Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.| |false|
2223
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2324
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|

docs/generators/typescript-inversify.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1818
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
1919
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2020
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
21+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2122
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2223
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2324
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

docs/generators/typescript-jquery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1919
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
2020
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2121
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
22+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2223
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2324
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2425
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

docs/generators/typescript-nestjs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2222
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
2323
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2424
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
25+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2526
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2627
|serviceFileSuffix|The suffix of the file of the generated service (service&lt;suffix&gt;.ts).| |.service|
2728
|serviceSuffix|The suffix of the generated service.| |Service|

docs/generators/typescript-node.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1818
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
1919
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
2020
|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false|
21+
|paramNaming|Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
2122
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
2223
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
2324
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|

0 commit comments

Comments
 (0)