[PHP] Use appDescription in composer.mustache (#1485)

* Use appDescription in composer.mustache

* Update petstore files

* More updated php petstore files

* Yet another updated php petstore file

* Use "{{{appDescription}}}" instead of "{{appDescription}}"
This commit is contained in:
Alwin Garside 2018-11-20 02:30:14 +01:00 committed by Akihito Nakano
parent 2b58f6737a
commit 792f95eb09
12 changed files with 36 additions and 28 deletions

View File

@ -3,7 +3,7 @@
{{#artifactVersion}} {{#artifactVersion}}
"version": "{{artifactVersion}}", "version": "{{artifactVersion}}",
{{/artifactVersion}} {{/artifactVersion}}
"description": "{{description}}", "description": "{{{appDescription}}}",
"keywords": [ "keywords": [
"openapitools", "openapitools",
"openapi-generator", "openapi-generator",

View File

@ -1,6 +1,6 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"description": "", "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --",
"keywords": [ "keywords": [
"openapitools", "openapitools",
"openapi-generator", "openapi-generator",

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**
@ -253,10 +253,10 @@ class FakeApi
// for model (json/xml) // for model (json/xml)
if (isset($_tempBody)) { if (isset($_tempBody)) {
// $_tempBody is the method argument, if present // $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody; $httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
} }
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
if ($multipart) { if ($multipart) {

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech * Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT * OpenAPI Generator version: 3.3.4-SNAPSHOT
*/ */
/** /**
@ -29,6 +29,8 @@
namespace OpenAPI\Client; namespace OpenAPI\Client;
use OpenAPI\Client\Model\ModelInterface;
/** /**
* ObjectSerializer Class Doc Comment * ObjectSerializer Class Doc Comment
* *
@ -61,6 +63,7 @@ class ObjectSerializer
return $data; return $data;
} elseif (is_object($data)) { } elseif (is_object($data)) {
$values = []; $values = [];
if ($data instanceof ModelInterface) {
$formats = $data::openAPIFormats(); $formats = $data::openAPIFormats();
foreach ($data::openAPITypes() as $property => $openAPIType) { foreach ($data::openAPITypes() as $property => $openAPIType) {
$getter = $data::getters()[$property]; $getter = $data::getters()[$property];
@ -76,6 +79,11 @@ class ObjectSerializer
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
} }
} }
} else {
foreach($data as $property => $value) {
$values[$property] = self::sanitizeForSerialization($value);
}
}
return (object)$values; return (object)$values;
} else { } else {
return (string)$data; return (string)$data;

View File

@ -1,6 +1,6 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"description": "", "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"keywords": [ "keywords": [
"openapitools", "openapitools",
"openapi-generator", "openapi-generator",

View File

@ -1,6 +1,6 @@
{ {
"name": "GIT_USER_ID/GIT_REPO_ID", "name": "GIT_USER_ID/GIT_REPO_ID",
"description": "", "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"keywords": [ "keywords": [
"openapitools", "openapitools",
"openapi-generator", "openapi-generator",