Skip to content

Commit 4e4c00e

Browse files
author
Mostafa Aghajani
committed
feat: enhance variableNamingConvention options to include 'off' and detailed descriptions in documentation
1 parent 05e7311 commit 4e4c00e

10 files changed

Lines changed: 13 additions & 9 deletions

File tree

docs/generators/php-dt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
41-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
41+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4242

4343
## IMPORT MAPPING
4444

docs/generators/php-flight.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
41-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase|
41+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|camelCase|
4242

4343
## IMPORT MAPPING
4444

docs/generators/php-laravel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
41-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|`camelCase`, `PascalCase`, `snake_case`, `off`|snake_case|
41+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4242

4343
## IMPORT MAPPING
4444

docs/generators/php-lumen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3737
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3838
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
3939
|srcBasePath|The directory to serve as source root.| |null|
40-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
40+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4141

4242
## IMPORT MAPPING
4343

docs/generators/php-mezzio-ph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
41-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
41+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4242

4343
## IMPORT MAPPING
4444

docs/generators/php-nextgen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
4141
|supportStreaming|Support streaming endpoint| |false|
42-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
42+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4343

4444
## IMPORT MAPPING
4545

docs/generators/php-slim4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3939
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4040
|srcBasePath|The directory to serve as source root.| |null|
41-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase|
41+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|camelCase|
4242

4343
## IMPORT MAPPING
4444

docs/generators/php-symfony.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4343
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
4444
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4545
|srcBasePath|The directory to serve as source root.| |null|
46-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
46+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4747

4848
## IMPORT MAPPING
4949

docs/generators/php.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3939
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
4040
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
4141
|srcBasePath|The directory to serve as source root.| |null|
42-
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
42+
|variableNamingConvention|naming convention of variable name, e.g. camelCase.|<dl><dt>**camelCase**</dt><dd>Use camelCase convention</dd><dt>**PascalCase**</dt><dd>Use PascalCase convention</dd><dt>**snake_case**</dt><dd>Use snake_case convention</dd><dt>**off**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4343

4444
## IMPORT MAPPING
4545

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ public AbstractPhpCodegen() {
149149
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
150150
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
151151
cliOptions.add(new CliOption(VARIABLE_NAMING_CONVENTION, "naming convention of variable name, e.g. camelCase.")
152+
.addEnum("camelCase", "Use camelCase convention")
153+
.addEnum("PascalCase", "Use PascalCase convention")
154+
.addEnum("snake_case", "Use snake_case convention")
155+
.addEnum("off", "Do not change the variable name")
152156
.defaultValue("snake_case"));
153157
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay\\Pets"));
154158
cliOptions.add(new CliOption(PACKAGE_NAME, "The main package name for classes. e.g. GeneratedPetstore"));

0 commit comments

Comments
 (0)