Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !13420

fix double in php generator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed William Cheng requested to merge php-fix-double into master 2 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 13

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
Compare
  • master (base)

and
  • latest version
    37bd2667
    1 commit, 2 years ago

13 files
+ 31
- 34

    Preferences

    File browser
    Compare changes
modules/…/…/…/…‎/…/…/…/languages‎
AbstractPhp‎Codegen.java‎ +1 -2
PhpLaravelServ‎erCodegen.java‎ +1 -1
PhpSilexServe‎rCodegen.java‎ +1 -2
PhpSymfonyServ‎erCodegen.java‎ +2 -3
sam‎ples‎
client/petstore/ph‎p/OpenAPIClient-php‎
do‎cs‎
A‎pi‎
FakeA‎pi.md‎ +4 -4
Mo‎del‎
EnumT‎est.md‎ +1 -1
Format‎Test.md‎ +1 -1
l‎ib‎
A‎pi‎
FakeA‎pi.php‎ +10 -10
Mo‎del‎
EnumTe‎st.php‎ +3 -3
FormatT‎est.php‎ +3 -3
ObjectSeri‎alizer.php‎ +2 -2
server/petstore‎/…/…/app/Models‎
EnumTe‎st.php‎ +1 -1
FormatT‎est.php‎ +1 -1
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
+ 1
- 2
  • View file @ 37bd2667


@@ -91,7 +91,6 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
"boolean",
"int",
"integer",
"double",
"float",
"string",
"object",
@@ -119,7 +118,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
typeMapping.put("number", "float");
typeMapping.put("float", "float");
typeMapping.put("decimal", "float");
typeMapping.put("double", "double");
typeMapping.put("double", "float");
typeMapping.put("string", "string");
typeMapping.put("byte", "int");
typeMapping.put("boolean", "bool");
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java
+ 1
- 1
  • View file @ 37bd2667


@@ -382,7 +382,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
}
// number
if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
if ("int".equals(datatype) || "float".equals(datatype)) {
String varName = "NUMBER_" + value;
varName = varName.replaceAll("-", "MINUS_");
varName = varName.replaceAll("\\+", "PLUS_");
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java
+ 1
- 2
  • View file @ 37bd2667


@@ -98,7 +98,6 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
"boolean",
"int",
"integer",
"double",
"float",
"string",
"object",
@@ -115,7 +114,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf
typeMapping.put("integer", "int");
typeMapping.put("long", "int");
typeMapping.put("float", "float");
typeMapping.put("double", "double");
typeMapping.put("double", "float");
typeMapping.put("string", "string");
typeMapping.put("byte", "int");
typeMapping.put("boolean", "boolean");
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java
+ 2
- 3
  • View file @ 37bd2667


@@ -147,7 +147,6 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
Arrays.asList(
"bool",
"int",
"double",
"float",
"string",
"object",
@@ -183,7 +182,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
typeMapping.put("decimal", "float");
typeMapping.put("number", "float");
typeMapping.put("float", "float");
typeMapping.put("double", "double");
typeMapping.put("double", "float");
typeMapping.put("string", "string");
typeMapping.put("byte", "int");
typeMapping.put("boolean", "bool");
@@ -588,7 +587,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
@Override
public String toEnumValue(String value, String datatype) {
if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) {
if ("int".equals(datatype) || "float".equals(datatype)) {
return value;
} else {
return "\"" + escapeText(value) + "\"";
samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md
+ 4
- 4
  • View file @ 37bd2667


@@ -664,7 +664,7 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi(
$config
);
$number = 3.4; // float | None
$double = 3.4; // double | None
$double = 3.4; // float | None
$pattern_without_delimiter = 'pattern_without_delimiter_example'; // string | None
$byte = 'byte_example'; // string | None
$integer = 56; // int | None
@@ -690,7 +690,7 @@ try {
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **number** | **float**| None | |
| **double** | **double**| None | |
| **double** | **float**| None | |
| **pattern_without_delimiter** | **string**| None | |
| **byte** | **string**| None | |
| **integer** | **int**| None | [optional] |
@@ -749,7 +749,7 @@ $enum_header_string = '-efg'; // string | Header parameter enum test (string)
$enum_query_string_array = array('enum_query_string_array_example'); // string[] | Query parameter enum test (string array)
$enum_query_string = '-efg'; // string | Query parameter enum test (string)
$enum_query_integer = 56; // int | Query parameter enum test (double)
$enum_query_double = 3.4; // double | Query parameter enum test (double)
$enum_query_double = 3.4; // float | Query parameter enum test (double)
$enum_query_model_array = array(new \OpenAPI\Client\Model\\OpenAPI\Client\Model\EnumClass()); // \OpenAPI\Client\Model\EnumClass[]
$enum_form_string_array = array('$'); // string[] | Form parameter enum test (string array)
$enum_form_string = '-efg'; // string | Form parameter enum test (string)
@@ -770,7 +770,7 @@ try {
| **enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional] |
| **enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to '-efg'] |
| **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] |
| **enum_query_double** | **double**| Query parameter enum test (double) | [optional] |
| **enum_query_double** | **float**| Query parameter enum test (double) | [optional] |
| **enum_query_model_array** | [**\OpenAPI\Client\Model\EnumClass[]**](../Model/\OpenAPI\Client\Model\EnumClass.md)| | [optional] |
| **enum_form_string_array** | [**string[]**](../Model/string.md)| Form parameter enum test (string array) | [optional] [default to '$'] |
| **enum_form_string** | **string**| Form parameter enum test (string) | [optional] [default to '-efg'] |
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
William Cheng
Reference: OpenAPITools/openapi-generator!13420
Source branch: php-fix-double

Menu

Explore Projects Groups Snippets