From cce21abaec22d24d0355c0e97e2e351546570839 Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 12:17:57 +0200 Subject: [PATCH 1/6] Removed printing artifactVersion if it is not set --- .../swagger-codegen/src/main/resources/php/README.mustache | 4 ++-- .../src/main/resources/php/configuration.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 1f96e378f1..125f4212dd 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,8 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -- Package version: {{artifactVersion}} -- Build date: {{generatedDate}} +{{#artifactVersion}}- Package version: {{artifactVersion}} +{{/artifactVersion}}- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 1b920e4835..57652c7a2a 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -110,7 +110,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}"; + protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/artifactVersion}}/php{{/httpUserAgent}}"; /** * Debug switch (default set to false) From c54b4faf139e6886d7c9ec23a41a5a664fcffeb4 Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:02:41 +0200 Subject: [PATCH 2/6] Removed printing artifactVersion if it is not set from debug information --- .../src/main/resources/php/configuration.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 57652c7a2a..edc3e787c1 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,8 +516,8 @@ class Configuration $report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n"; - $report .= " SDK Package Version: {{artifactVersion}}\n"; + $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} + $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; return $report; From 18f32b416322cffc27219424239c05e289e0513e Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:03:31 +0200 Subject: [PATCH 3/6] Proper printing of invokerPackage in configuration debug report --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index edc3e787c1..a3407542ed 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -513,7 +513,7 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; + $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} From 3484704fea1d48cf0a3346ee3e05743323a389bd Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:07:51 +0200 Subject: [PATCH 4/6] Updated condition for artifactVersion check --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index a3407542ed..d2a2078fae 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,7 +516,7 @@ class Configuration $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} + $report .= " OpenAPI Spec Version: {{version}}\n";{{#artifactVersion}} $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; From 030b1bc8c29ef4760c432d801645f2d3e87c8f7b Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Thu, 26 May 2016 15:12:28 +0200 Subject: [PATCH 5/6] added default version 1.0.0 to userAgent --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index d2a2078fae..b5fc7f739f 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -110,7 +110,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/artifactVersion}}/php{{/httpUserAgent}}"; + protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}"; /** * Debug switch (default set to false) From 8369bae08a6c818a2a91ae538be7078be23eb9ac Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Mon, 30 May 2016 15:01:53 +0200 Subject: [PATCH 6/6] Improved formatting --- .../swagger-codegen/src/main/resources/php/README.mustache | 6 ++++-- .../src/main/resources/php/composer.mustache | 6 ++++-- .../src/main/resources/php/configuration.mustache | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 125f4212dd..aa1ace0397 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,10 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -{{#artifactVersion}}- Package version: {{artifactVersion}} -{{/artifactVersion}}- Build date: {{generatedDate}} +{{#artifactVersion}} +- Package version: {{artifactVersion}} +{{/artifactVersion}} +- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index c52052346e..477e081932 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -1,6 +1,8 @@ { - "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",{{#artifactVersion}} - "version": "{{artifactVersion}}",{{/artifactVersion}} + "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}", + {{#artifactVersion}} + "version": "{{artifactVersion}}", + {{/artifactVersion}} "description": "{{description}}", "keywords": [ "swagger", diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index b5fc7f739f..b6e49fb50f 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,8 +516,10 @@ class Configuration $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n";{{#artifactVersion}} - $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} + $report .= " OpenAPI Spec Version: {{version}}\n"; + {{#artifactVersion}} + $report .= " SDK Package Version: {{artifactVersion}}\n"; + {{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; return $report;