Skip to content

Commit fa64c8e

Browse files
authored
Issue: #21334 Abstract PHP support of "original" for variableNamingConvention (#21336)
* feat(php): add support for 'off' variable naming convention in AbstractPhpCodegen * feat(php-laravel): add tests for issue 21334 with API and model definitions * feat(php-laravel): update variableNamingConvention option in php-laravel help file to include 'off' as a valid value * feat: enhance variableNamingConvention options to include 'off' and detailed descriptions in documentation * feat(php): update variableNamingConvention from 'off' to 'original' in AbstractPhpCodegen * feat: include php-laravel-issue-21334 in workflow triggers for push and pull_request events
1 parent fbd94d5 commit fa64c8e

File tree

25 files changed

+423
-9
lines changed

25 files changed

+423
-9
lines changed

.github/workflows/samples-php8.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
77
- samples/server/petstore/php-flight/**
88
- samples/server/petstore/php-laravel/**
9+
- samples/server/petstore/php-laravel-issue-21334/**
910
pull_request:
1011
paths:
1112
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
1213
- samples/server/petstore/php-flight/**
1314
- samples/server/petstore/php-laravel/**
15+
- samples/server/petstore/php-laravel-issue-21334/**
1416
jobs:
1517
build:
1618
name: Build PHP projects
@@ -28,6 +30,7 @@ jobs:
2830
- samples/server/petstore/php-symfony/SymfonyBundle-php/
2931
- samples/server/petstore/php-flight/
3032
- samples/server/petstore/php-laravel/
33+
- samples/server/petstore/php-laravel-issue-21334/
3134
steps:
3235
- uses: actions/checkout@v4
3336
- name: Setup PHP with tools
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
generatorName: php-laravel
2+
outputDir: samples/server/petstore/php-laravel-issue-21334
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue21334.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/php-laravel
5+
gitUserId: openapitools
6+
gitRepoId: petstore
7+
additionalProperties:
8+
variableNamingConvention: "original"

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>**original**</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>**original**</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.| |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>**original**</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>**original**</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>**original**</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>**original**</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>**original**</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>**original**</dt><dd>Do not change the variable name</dd></dl>|snake_case|
4747

4848
## IMPORT MAPPING
4949

0 commit comments

Comments
 (0)