forked from loafle/openapi-generator-original
[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:
parent
2b58f6737a
commit
792f95eb09
@ -3,7 +3,7 @@
|
||||
{{#artifactVersion}}
|
||||
"version": "{{artifactVersion}}",
|
||||
{{/artifactVersion}}
|
||||
"description": "{{description}}",
|
||||
"description": "{{{appDescription}}}",
|
||||
"keywords": [
|
||||
"openapitools",
|
||||
"openapi-generator",
|
||||
|
@ -1 +1 @@
|
||||
3.3.0-SNAPSHOT
|
||||
3.3.4-SNAPSHOT
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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": [
|
||||
"openapitools",
|
||||
"openapi-generator",
|
||||
|
@ -17,7 +17,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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)
|
||||
if (isset($_tempBody)) {
|
||||
// $_tempBody is the method argument, if present
|
||||
$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);
|
||||
if ($headers['Content-Type'] === 'application/json') {
|
||||
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
|
||||
} else {
|
||||
$httpBody = $_tempBody;
|
||||
}
|
||||
} elseif (count($formParams) > 0) {
|
||||
if ($multipart) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.0-SNAPSHOT
|
||||
* OpenAPI Generator version: 3.3.4-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.0-SNAPSHOT
|
||||
* OpenAPI Generator version: 3.3.4-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.0-SNAPSHOT
|
||||
* OpenAPI Generator version: 3.3.4-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.0-SNAPSHOT
|
||||
* OpenAPI Generator version: 3.3.4-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.0-SNAPSHOT
|
||||
* OpenAPI Generator version: 3.3.4-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@
|
||||
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* 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;
|
||||
|
||||
use OpenAPI\Client\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* ObjectSerializer Class Doc Comment
|
||||
*
|
||||
@ -61,19 +63,25 @@ class ObjectSerializer
|
||||
return $data;
|
||||
} elseif (is_object($data)) {
|
||||
$values = [];
|
||||
$formats = $data::openAPIFormats();
|
||||
foreach ($data::openAPITypes() as $property => $openAPIType) {
|
||||
$getter = $data::getters()[$property];
|
||||
$value = $data->$getter();
|
||||
if ($value !== null
|
||||
&& !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
|
||||
&& method_exists($openAPIType, 'getAllowableEnumValues')
|
||||
&& !in_array($value, $openAPIType::getAllowableEnumValues(), true)) {
|
||||
$imploded = implode("', '", $openAPIType::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'");
|
||||
if ($data instanceof ModelInterface) {
|
||||
$formats = $data::openAPIFormats();
|
||||
foreach ($data::openAPITypes() as $property => $openAPIType) {
|
||||
$getter = $data::getters()[$property];
|
||||
$value = $data->$getter();
|
||||
if ($value !== null
|
||||
&& !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
|
||||
&& method_exists($openAPIType, 'getAllowableEnumValues')
|
||||
&& !in_array($value, $openAPIType::getAllowableEnumValues(), true)) {
|
||||
$imploded = implode("', '", $openAPIType::getAllowableEnumValues());
|
||||
throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'");
|
||||
}
|
||||
if ($value !== null) {
|
||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
|
||||
}
|
||||
}
|
||||
if ($value !== null) {
|
||||
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
|
||||
} else {
|
||||
foreach($data as $property => $value) {
|
||||
$values[$property] = self::sanitizeForSerialization($value);
|
||||
}
|
||||
}
|
||||
return (object)$values;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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": [
|
||||
"openapitools",
|
||||
"openapi-generator",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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": [
|
||||
"openapitools",
|
||||
"openapi-generator",
|
||||
|
Loading…
x
Reference in New Issue
Block a user