diff --git a/.gitignore b/.gitignore
index e24cf380cfea..d26b36c969f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -181,6 +181,7 @@ samples/server/petstore/php-laravel/lib/composer.lock
samples/server/petstore/php-lumen/lib/composer.lock
samples/server/petstore/php-slim4/composer.lock
samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
+samples/server/petstore/php-symfony5/SymfonyBundle-php/composer.lock
samples/server/petstore/php-ze-ph/composer.lock
# ts
diff --git a/bin/configs/php-symfony5.yaml b/bin/configs/php-symfony5.yaml
new file mode 100644
index 000000000000..5d04ff8d0e4e
--- /dev/null
+++ b/bin/configs/php-symfony5.yaml
@@ -0,0 +1,4 @@
+generatorName: php-symfony5
+outputDir: samples/server/petstore/php-symfony5/SymfonyBundle-php
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/php-symfony5-server
diff --git a/docs/generators.md b/docs/generators.md
index 45fb3721dc73..dda9ddbd2990 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -111,6 +111,7 @@ The following generators are available:
* [php-slim-deprecated (deprecated)](generators/php-slim-deprecated.md)
* [php-slim4](generators/php-slim4.md)
* [php-symfony](generators/php-symfony.md)
+* [php-symfony5](generators/php-symfony5.md)
* [php-ze-ph](generators/php-ze-ph.md)
* [python-aiohttp](generators/python-aiohttp.md)
* [python-blueplanet](generators/python-blueplanet.md)
diff --git a/docs/generators/php-symfony5.md b/docs/generators/php-symfony5.md
new file mode 100644
index 000000000000..4ba936b06f00
--- /dev/null
+++ b/docs/generators/php-symfony5.md
@@ -0,0 +1,242 @@
+---
+title: Config Options for php-symfony5
+sidebar_label: php-symfony5
+---
+
+| Option | Description | Values | Default |
+| ------ | ----------- | ------ | ------- |
+|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
+|apiPackage|package for generated api classes| |null|
+|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
+|bundleAlias|The alias of the Symfony bundle. The template uses {{aliasName}}| |null|
+|bundleName|The name of the Symfony bundle. The template uses {{bundleName}}| |null|
+|composerProjectName|The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client| |null|
+|composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null|
+|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|
- **false**
- The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
- **true**
- when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.
|true|
+|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null|
+|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|- **true**
- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
- **false**
- The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
+|modelPackage|package for generated models| |null|
+|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
+|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
+|srcBasePath|The directory to serve as source root.| |null|
+|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+|array|array|
+|map|map|
+
+
+## LANGUAGE PRIMITIVES
+
+
+- array
+- bool
+- byte
+- double
+- float
+- int
+- mixed
+- number
+- object
+- string
+- void
+
+
+## RESERVED WORDS
+
+
+- __halt_compiler
+- _header_accept
+- _tempbody
+- abstract
+- and
+- array
+- as
+- break
+- callable
+- case
+- catch
+- class
+- clone
+- const
+- continue
+- declare
+- default
+- die
+- do
+- echo
+- else
+- elseif
+- empty
+- enddeclare
+- endfor
+- endforeach
+- endif
+- endswitch
+- endwhile
+- eval
+- exit
+- extends
+- final
+- for
+- foreach
+- formparams
+- function
+- global
+- goto
+- headerparams
+- httpbody
+- if
+- implements
+- include
+- include_once
+- instanceof
+- insteadof
+- interface
+- isset
+- list
+- namespace
+- new
+- or
+- print
+- private
+- protected
+- public
+- queryparams
+- require
+- require_once
+- resourcepath
+- return
+- static
+- switch
+- throw
+- trait
+- try
+- unset
+- use
+- var
+- while
+- xor
+
+
+## FEATURE SET
+
+
+### Client Modification Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasePath|✗|ToolingExtension
+|Authorizations|✗|ToolingExtension
+|UserAgent|✗|ToolingExtension
+|MockServer|✗|ToolingExtension
+
+### Data Type Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Custom|✗|OAS2,OAS3
+|Int32|✓|OAS2,OAS3
+|Int64|✓|OAS2,OAS3
+|Float|✓|OAS2,OAS3
+|Double|✓|OAS2,OAS3
+|Decimal|✓|ToolingExtension
+|String|✓|OAS2,OAS3
+|Byte|✓|OAS2,OAS3
+|Binary|✓|OAS2,OAS3
+|Boolean|✓|OAS2,OAS3
+|Date|✓|OAS2,OAS3
+|DateTime|✓|OAS2,OAS3
+|Password|✓|OAS2,OAS3
+|File|✓|OAS2
+|Array|✓|OAS2,OAS3
+|Maps|✓|ToolingExtension
+|CollectionFormat|✓|OAS2
+|CollectionFormatMulti|✓|OAS2
+|Enum|✓|OAS2,OAS3
+|ArrayOfEnum|✓|ToolingExtension
+|ArrayOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
+|ArrayOfCollectionOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfEnum|✓|ToolingExtension
+|MapOfEnum|✓|ToolingExtension
+|MapOfModel|✓|ToolingExtension
+|MapOfCollectionOfPrimitives|✓|ToolingExtension
+|MapOfCollectionOfModel|✓|ToolingExtension
+|MapOfCollectionOfEnum|✓|ToolingExtension
+
+### Documentation Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Readme|✓|ToolingExtension
+|Model|✓|ToolingExtension
+|Api|✓|ToolingExtension
+
+### Global Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Host|✓|OAS2,OAS3
+|BasePath|✓|OAS2,OAS3
+|Info|✓|OAS2,OAS3
+|Schemes|✗|OAS2,OAS3
+|PartialSchemes|✓|OAS2,OAS3
+|Consumes|✓|OAS2
+|Produces|✓|OAS2
+|ExternalDocumentation|✓|OAS2,OAS3
+|Examples|✓|OAS2,OAS3
+|XMLStructureDefinitions|✗|OAS2,OAS3
+|MultiServer|✗|OAS3
+|ParameterizedServer|✗|OAS3
+|ParameterStyling|✗|OAS3
+|Callbacks|✗|OAS3
+|LinkObjects|✗|OAS3
+
+### Parameter Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Path|✓|OAS2,OAS3
+|Query|✓|OAS2,OAS3
+|Header|✓|OAS2,OAS3
+|Body|✓|OAS2
+|FormUnencoded|✓|OAS2
+|FormMultipart|✓|OAS2
+|Cookie|✓|OAS3
+
+### Schema Support Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Simple|✓|OAS2,OAS3
+|Composite|✓|OAS2,OAS3
+|Polymorphism|✗|OAS2,OAS3
+|Union|✗|OAS3
+
+### Security Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasicAuth|✗|OAS2,OAS3
+|ApiKey|✗|OAS2,OAS3
+|OpenIDConnect|✗|OAS3
+|BearerToken|✗|OAS3
+|OAuth2_Implicit|✗|OAS2,OAS3
+|OAuth2_Password|✗|OAS2,OAS3
+|OAuth2_ClientCredentials|✗|OAS2,OAS3
+|OAuth2_AuthorizationCode|✗|OAS2,OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfony5ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfony5ServerCodegen.java
new file mode 100644
index 000000000000..4ea4e89d4e14
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfony5ServerCodegen.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.languages;
+
+import org.openapitools.codegen.SupportingFile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.File;
+
+public class PhpSymfony5ServerCodegen extends PhpSymfonyServerCodegen {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PhpSymfony5ServerCodegen.class);
+
+ public PhpSymfony5ServerCodegen() {
+ super();
+
+ embeddedTemplateDir = templateDir = "php-symfony5-server";
+
+ // remove phpLegacySupport option because Symfony5 requires PHP >= 7.2.5
+ removeOption(PHP_LEGACY_SUPPORT);
+ }
+
+ @Override
+ public String getName() {
+ return "php-symfony5";
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a PHP Symfony 5 server bundle.";
+ }
+
+ @Override
+ public void processOpts() {
+ super.processOpts();
+
+ final String configDir = "Resources" + File.separator + "config";
+ final String dependencyInjectionDir = "DependencyInjection";
+
+ supportingFiles.clear();
+ // supportingFiles.add(new SupportingFile("Controller.mustache", toSrcPath(controllerPackage, srcBasePath), "Controller.php"));
+ // supportingFiles.add(new SupportingFile("Bundle.mustache", "", bundleClassName + ".php"));
+ // supportingFiles.add(new SupportingFile("Extension.mustache", dependencyInjectionDir, bundleExtensionName + ".php"));
+ // supportingFiles.add(new SupportingFile("ApiPass.mustache", dependencyInjectionDir + File.separator + "Compiler", bundleName + "ApiPass.php"));
+ // supportingFiles.add(new SupportingFile("ApiServer.mustache", toSrcPath(apiPackage, srcBasePath), "ApiServer.php"));
+
+ // Serialization components
+ // supportingFiles.add(new SupportingFile("serialization/SerializerInterface.mustache", toSrcPath(servicePackage, srcBasePath), "SerializerInterface.php"));
+ // supportingFiles.add(new SupportingFile("serialization/JmsSerializer.mustache", toSrcPath(servicePackage, srcBasePath), "JmsSerializer.php"));
+ // supportingFiles.add(new SupportingFile("serialization/StrictJsonDeserializationVisitor.mustache", toSrcPath(servicePackage, srcBasePath), "StrictJsonDeserializationVisitor.php"));
+ // supportingFiles.add(new SupportingFile("serialization/TypeMismatchException.mustache", toSrcPath(servicePackage, srcBasePath), "TypeMismatchException.php"));
+ // Validation components
+ // supportingFiles.add(new SupportingFile("validation/ValidatorInterface.mustache", toSrcPath(servicePackage, srcBasePath), "ValidatorInterface.php"));
+ // supportingFiles.add(new SupportingFile("validation/SymfonyValidator.mustache", toSrcPath(servicePackage, srcBasePath), "SymfonyValidator.php"));
+
+ // Testing components
+ // supportingFiles.add(new SupportingFile("testing/phpunit.xml.mustache", "", "phpunit.xml.dist"));
+ // supportingFiles.add(new SupportingFile("testing/pom.xml", "", "pom.xml"));
+ // supportingFiles.add(new SupportingFile("testing/AppKernel.mustache", toSrcPath(testsPackage, srcBasePath), "AppKernel.php"));
+ // supportingFiles.add(new SupportingFile("testing/ControllerTest.mustache", toSrcPath(controllerTestsPackage, srcBasePath), "ControllerTest.php"));
+ // supportingFiles.add(new SupportingFile("testing/test_config.yml", toSrcPath(testsPackage, srcBasePath), "test_config.yml"));
+
+ // supportingFiles.add(new SupportingFile("routing.mustache", configDir, "routing.yml"));
+ // supportingFiles.add(new SupportingFile("services.mustache", configDir, "services.yml"));
+ supportingFiles.add(new SupportingFile("composer.mustache", "", "composer.json"));
+ // supportingFiles.add(new SupportingFile("autoload.mustache", "", "autoload.php"));
+ // supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
+
+ // supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml"));
+ // supportingFiles.add(new SupportingFile(".php_cs.dist", "", ".php_cs.dist"));
+ // supportingFiles.add(new SupportingFile(".coveralls.yml", "", ".coveralls.yml"));
+ // supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
index 87020fffa16e..2382d98a28c6 100644
--- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
+++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
@@ -86,6 +86,7 @@ org.openapitools.codegen.languages.PhpSlimServerCodegen
org.openapitools.codegen.languages.PhpSlim4ServerCodegen
org.openapitools.codegen.languages.PhpSilexServerCodegen
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
+org.openapitools.codegen.languages.PhpSymfony5ServerCodegen
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
org.openapitools.codegen.languages.PowerShellClientCodegen
org.openapitools.codegen.languages.ProtobufSchemaCodegen
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/.coveralls.yml b/modules/openapi-generator/src/main/resources/php-symfony5-server/.coveralls.yml
new file mode 100644
index 000000000000..4071b53a9522
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/.coveralls.yml
@@ -0,0 +1,5 @@
+service_name: travis-ci # travis-ci or travis-pro
+
+# for php-coveralls
+coverage_clover: report/logs/clover.xml
+json_path: report/logs/coveralls-upload.json
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/.php_cs.dist b/modules/openapi-generator/src/main/resources/php-symfony5-server/.php_cs.dist
new file mode 100644
index 000000000000..df19888e44ff
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/.php_cs.dist
@@ -0,0 +1,20 @@
+in(__DIR__)
+;
+
+return PhpCsFixer\Config::create()
+ ->setUsingCache(true)
+ ->setRules([
+ '@PSR2' => true,
+ 'ordered_imports' => [
+ 'sort_algorithm' => 'alpha'
+ ],
+ 'phpdoc_order' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'strict_comparison' => true,
+ 'strict_param' => true
+ ])
+ ->setFinder($finder)
+;
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/.travis.yml b/modules/openapi-generator/src/main/resources/php-symfony5-server/.travis.yml
new file mode 100644
index 000000000000..de5a983645fc
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/.travis.yml
@@ -0,0 +1,20 @@
+language: php
+dist: trusty
+php:
+ - 7.1.3
+ - 7.2
+
+install:
+ - composer install --dev --no-interaction
+script:
+ - mkdir -p report/logs
+ - php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=report/logs/clover.xml
+ - php vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no
+
+before_script:
+ - composer require --dev php-coveralls/php-coveralls --no-interaction
+
+after_success:
+ - travis_retry php vendor/bin/php-coveralls
+ # or enable logging
+ - travis_retry php vendor/bin/php-coveralls -v
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiPass.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiPass.mustache
new file mode 100644
index 000000000000..10bf6bea00cb
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiPass.mustache
@@ -0,0 +1,60 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{invokerPackage}}\DependencyInjection\Compiler;
+
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Reference;
+
+/**
+ * {{bundleName}}ApiPass Class Doc Comment
+ *
+ * @category Class
+ * @package {{invokerPackage}}\DependencyInjection\Compiler
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class {{bundleName}}ApiPass implements CompilerPassInterface
+{
+
+ /**
+ * You can modify the container here before it is dumped to PHP code.
+ *
+ * @param ContainerBuilder $container
+ */
+ public function process(ContainerBuilder $container) {
+ // always first check if the primary service is defined
+ if (!$container->has('{{bundleAlias}}.api.api_server')) {
+ return;
+ }
+
+ $definition = $container->findDefinition('{{bundleAlias}}.api.api_server');
+
+ // find all service IDs with the {{bundleAlias}}.api tag
+ $taggedServices = $container->findTaggedServiceIds('{{bundleAlias}}.api');
+
+ foreach ($taggedServices as $id => $tags) {
+ foreach ($tags as $tag) {
+ // add the transport service to the ChainTransport service
+ $definition->addMethodCall('addApiHandler', [$tag['api'], new Reference($id)]);
+ }
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiServer.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiServer.mustache
new file mode 100644
index 000000000000..1e902459ef00
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/ApiServer.mustache
@@ -0,0 +1,70 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{apiPackage}};
+
+/**
+ * ApiServer Class Doc Comment
+ *
+ * PHP version 5
+ *
+ * @category Class
+ * @package {{apiPackage}}
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class ApiServer
+{
+
+ /**
+ * @var array
+ */
+ private $apis = array();
+
+ /**
+ * Adds an API handler to the server.
+ *
+ * @param string $api An API name of the handle
+ * @param mixed $handler A handler to set for the given API
+ */
+ public function addApiHandler($api, $handler)
+ {
+ if (isset($this->apis[$api])) {
+ throw new \InvalidArgumentException('API has already a handler: '.$api);
+ }
+
+ $this->apis[$api] = $handler;
+ }
+
+ /**
+ * Returns an API handler.
+ *
+ * @param string $api An API name of the handle
+ * @return mixed Returns a handler
+ * @throws \InvalidArgumentException When no such handler exists
+ */
+ public function getApiHandler($api)
+ {
+ if (!isset($this->apis[$api])) {
+ throw new \InvalidArgumentException('No handler for '.$api.' implemented.');
+ }
+
+ return $this->apis[$api];
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/Bundle.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/Bundle.mustache
new file mode 100644
index 000000000000..4bbbf5062d8f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/Bundle.mustache
@@ -0,0 +1,40 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{invokerPackage}};
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use {{invokerPackage}}\DependencyInjection\Compiler\{{bundleName}}ApiPass;
+
+/**
+ * {{bundleClassName}} Class Doc Comment
+ *
+ * @category Class
+ * @package {{invokerPackage}}
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class {{bundleClassName}} extends Bundle
+{
+ public function build(ContainerBuilder $container)
+ {
+ $container->addCompilerPass(new {{bundleName}}ApiPass());
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/Controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/Controller.mustache
new file mode 100644
index 000000000000..bafc3668ff33
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/Controller.mustache
@@ -0,0 +1,216 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{controllerPackage}};
+
+use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+use {{servicePackage}}\SerializerInterface;
+use {{servicePackage}}\ValidatorInterface;
+
+/**
+ * Controller Class Doc Comment
+ *
+ * @category Class
+ * @package {{controllerPackage}}
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class Controller extends AbstractController
+{
+ protected $validator;
+ protected $serializer;
+ protected $apiServer;
+
+ public function setValidator(ValidatorInterface $validator)
+ {
+ $this->validator = $validator;
+ }
+
+ public function setSerializer(SerializerInterface $serializer)
+ {
+ $this->serializer = $serializer;
+ }
+
+ public function setApiServer($server)
+ {
+ $this->apiServer = $server;
+ }
+
+ /**
+ * This will return a response with code 400. Usage example:
+ * return $this->createBadRequestResponse('Unable to access this page!');
+ *
+ * @param string $message A message
+ *
+ * @return Response
+ */
+ public function createBadRequestResponse($message = 'Bad Request.')
+ {
+ return new Response($message, 400);
+ }
+
+ /**
+ * This will return an error response. Usage example:
+ * return $this->createErrorResponse(new UnauthorizedHttpException());
+ *
+ * @param HttpException $exception An HTTP exception
+ *
+ * @return Response
+ */
+ public function createErrorResponse(HttpException $exception)
+ {
+ $statusCode = $exception->getStatusCode();
+ $headers = array_merge($exception->getHeaders(), ['Content-Type' => 'application/json']);
+
+ $json = $this->exceptionToArray($exception);
+ $json['statusCode'] = $statusCode;
+
+ return new Response(json_encode($json, 15, 512), $statusCode, $headers);
+ }
+
+ /**
+ * Serializes data to a given type format.
+ *
+ * @param mixed $data The data to serialize.
+ * @param string $class The source data class.
+ * @param string $format The target serialization format.
+ *
+ * @return string A serialized data string.
+ */
+ protected function serialize($data, $format)
+ {
+ return $this->serializer->serialize($data, $format);
+ }
+
+ /**
+ * Deserializes data from a given type format.
+ *
+ * @param string $data The data to deserialize.
+ * @param string $class The target data class.
+ * @param string $format The source serialization format.
+ *
+ * @return mixed A deserialized data.
+ */
+ protected function deserialize($data, $class, $format)
+ {
+ return $this->serializer->deserialize($data, $class, $format);
+ }
+
+ protected function validate($data, $asserts = null)
+ {
+ $errors = $this->validator->validate($data, $asserts);
+
+ if (count($errors) > 0) {
+ $errorsString = (string)$errors;
+ return $this->createBadRequestResponse($errorsString);
+ }
+ }
+
+ /**
+ * Converts an exception to a serializable array.
+ *
+ * @param \Exception|null $exception
+ *
+ * @return array
+ */
+ private function exceptionToArray(\Exception $exception = null)
+ {
+ if (null === $exception) {
+ return null;
+ }
+
+ if (!$this->container->get('kernel')->isDebug()) {
+ return [
+ 'message' => $exception->getMessage(),
+ ];
+ }
+
+ return [
+ 'message' => $exception->getMessage(),
+ 'type' => get_class($exception),
+ 'previous' => $this->exceptionToArray($exception->getPrevious()),
+ ];
+ }
+
+ protected function getOutputFormat($accept, array $produced)
+ {
+ // Figure out what the client accepts
+ $accept = preg_split("/[\s,]+/", $accept);
+
+ if (in_array('*/*', $accept) || in_array('application/*', $accept)) {
+ // Prefer JSON if the client has no preference
+ if (in_array('application/json', $produced)) {
+ return 'application/json';
+ }
+ if (in_array('application/xml', $produced)) {
+ return 'application/xml';
+ }
+ }
+
+ if (in_array('application/json', $accept) && in_array('application/json', $produced)) {
+ return 'application/json';
+ }
+
+ if (in_array('application/xml', $accept) && in_array('application/xml', $produced)) {
+ return 'application/xml';
+ }
+
+ // If we reach this point, we don't have a common ground between server and client
+ return null;
+ }
+
+ /**
+ * Checks whether Content-Type request header presented in supported formats.
+ *
+ * @param Request $request Request instance.
+ * @param array $consumes Array of supported content types.
+ *
+ * @return bool Returns true if Content-Type supported otherwise false.
+ */
+ public static function isContentTypeAllowed(Request $request, array $consumes = [])
+ {
+ if (!empty($consumes) && $consumes[0] !== '*/*') {
+ $currentFormat = $request->getContentType();
+ foreach ($consumes as $mimeType) {
+ // canonize mime type
+ if (is_string($mimeType) && false !== $pos = strpos($mimeType, ';')) {
+ $mimeType = trim(substr($mimeType, 0, $pos));
+ }
+
+ if (!$format = $request->getFormat($mimeType)) {
+ // add custom format to request
+ $format = $mimeType;
+ $request->setFormat($format, $format);
+ $currentFormat = $request->getContentType();
+ }
+
+ if ($format === $currentFormat) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/Extension.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/Extension.mustache
new file mode 100644
index 000000000000..4395c42aef0a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/Extension.mustache
@@ -0,0 +1,47 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{invokerPackage}}\DependencyInjection;
+
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Extension\Extension;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+
+/**
+ * {{bundleExtensionName}} Class Doc Comment
+ *
+ * @category Class
+ * @package {{invokerPackage}}\DependencyInjection
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class {{bundleExtensionName}} extends Extension
+{
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+ $loader->load('services.yml');
+ }
+
+ public function getAlias()
+ {
+ return '{{bundleAlias}}';
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/README.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/README.mustache
new file mode 100644
index 000000000000..e3451ecf3938
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/README.mustache
@@ -0,0 +1,181 @@
+# {{bundleName}}
+{{#appDescriptionWithNewLines}}
+{{{appDescriptionWithNewLines}}}
+{{/appDescriptionWithNewLines}}
+
+This [Symfony](https://symfony.com/) bundle is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+{{#artifactVersion}}
+- Package version: {{artifactVersion}}
+{{/artifactVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Requirements
+
+PHP 7.1.3 and later
+
+## Installation & Usage
+
+To install the dependencies via [Composer](http://getcomposer.org/), add the following repository to `composer.json` of your Symfony project:
+
+```json
+{
+ "repositories": [{
+ "type": "path",
+ "url": "//Path to your generated openapi bundle"
+ }],
+}
+```
+
+Then run:
+
+```
+composer require {{gitUserId}}/{{gitRepoId}}:dev-master
+```
+
+to add the generated openapi bundle as a dependency.
+
+## Tests
+
+To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands:
+
+```
+composer install
+./vendor/bin/phpunit
+```
+
+
+## Getting Started
+
+Step 1: Please follow the [installation procedure](#installation--usage) first.
+
+Step 2: Enable the bundle in the kernel:
+
+```php
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{apiPackage}};
+
+use Symfony\Component\HttpFoundation\File\UploadedFile;
+{{#operations}}{{#imports}}use {{import}};
+{{/imports}}
+
+/**
+ * {{classname}} Interface Doc Comment
+ *
+ * @category Interface
+ * @package {{apiPackage}}
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+interface {{classname}}
+{
+ {{#authMethods}}
+
+ /**
+ * Sets authentication method {{name}}
+ *
+ * @param string $value Value of the {{name}} authentication method.
+ *
+ * @return void
+ */
+ public function set{{name}}($value);
+ {{/authMethods}}
+ {{#operation}}
+
+ /**
+ * Operation {{{operationId}}}
+ {{#summary}}
+ *
+ * {{{summary}}}
+ {{/summary}}
+ *
+ {{#description}}
+ * {{.}}
+ *
+ {{/description}}
+ {{#allParams}}
+ * @param {{vendorExtensions.x-comment-type}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
+ {{/allParams}}
+ * @param integer $responseCode The HTTP response code to return
+ * @param array $responseHeaders Additional HTTP headers to return with the response ()
+ *
+ * @return {{{vendorExtensions.x-comment-type}}}
+ *
+ */
+ public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}&$responseCode, array &$responseHeaders);
+{{/operation}}
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/api_controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/api_controller.mustache
new file mode 100644
index 000000000000..95445bcbf0ec
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/api_controller.mustache
@@ -0,0 +1,217 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{controllerPackage}};
+
+use \Exception;
+use JMS\Serializer\Exception\RuntimeException as SerializerRuntimeException;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+use Symfony\Component\Validator\Constraints as Assert;
+use {{apiPackage}}\{{classname}};
+{{#imports}}use {{import}};
+{{/imports}}
+
+/**
+ * {{controllerName}} Class Doc Comment
+ *
+ * @category Class
+ * @package {{controllerPackage}}
+ * @author OpenAPI Generator team
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class {{controllerName}} extends Controller
+{
+ {{#operation}}
+
+ /**
+ * Operation {{{operationId}}}
+{{#summary}}
+ *
+ * {{{summary}}}
+{{/summary}}
+ *
+{{#description}}
+ * {{.}}
+ *
+{{/description}}
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function {{operationId}}Action(Request $request{{#hasPathParams}}{{#pathParams}}, ${{paramName}}{{/pathParams}}{{/hasPathParams}})
+ {
+ {{#bodyParams}}
+ // Make sure that the client is providing something that we can consume
+ $consumes = [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ {{/bodyParams}}
+ {{#returnType}}
+ // Figure out what data format to return to the client
+ $produces = [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ {{/returnType}}
+ // Handle authentication
+ {{#authMethods}}
+ // Authentication '{{name}}' required
+ {{#isApiKey}}
+ {{#isKeyInHeader}}
+ // Set key with prefix in header
+ $security{{name}} = $request->headers->get('{{keyParamName}}');
+ {{/isKeyInHeader}}
+ {{#isKeyInQuery}}
+ // Set key with prefix in query string
+ $security{{name}} = $request->query->get('{{keyParamName}}');
+ {{/isKeyInQuery}}
+ {{#isKeyInCookie}}
+ // Set key with prefix in cookies
+ $security{{name}} = $request->cookies->get('{{keyParamName}}');
+ {{/isKeyInCookie}}
+ {{/isApiKey}}
+ {{#isBasic}}
+ // HTTP basic authentication required
+ $security{{name}} = $request->headers->get('authorization');
+ {{/isBasic}}
+ {{#isOAuth}}
+ // Oauth required
+ $security{{name}} = $request->headers->get('authorization');
+ {{/isOAuth}}
+ {{/authMethods}}
+
+ // Read out all input parameter values into variables
+ {{#queryParams}}
+ ${{paramName}} = $request->query->get('{{paramName}}');
+ {{/queryParams}}
+ {{#headerParams}}
+ ${{paramName}} = $request->headers->get('{{baseName}}');
+ {{/headerParams}}
+ {{#formParams}}
+ {{#isFile}}
+ ${{paramName}} = $request->files->get('{{paramName}}');
+ {{/isFile}}
+ {{^isFile}}
+ ${{paramName}} = $request->request->get('{{paramName}}');
+ {{/isFile}}
+ {{/formParams}}
+ {{#bodyParams}}
+ ${{paramName}} = $request->getContent();
+ {{/bodyParams}}
+
+ // Use the default value if no value was provided
+ {{^required}}
+ {{#isContainer}}
+ {{#items}}
+ {{#defaultValue}}
+ ${{paramName}} = ${{paramName}}?:[{{{defaultValue}}}];
+ {{/defaultValue}}
+ {{/items}}
+ {{/isContainer}}
+ {{^isContainer}}
+ {{#defaultValue}}
+ ${{paramName}} = ${{paramName}}?:{{{defaultValue}}};
+ {{/defaultValue}}
+ {{/isContainer}}
+ {{/required}}
+
+ {{#hasParams}}
+ // Deserialize the input values that needs it
+ try {
+ {{#allParams}}
+ {{^isFile}}
+ {{#isBodyParam}}
+ $inputFormat = $request->getMimeType($request->getContentType());
+ ${{paramName}} = $this->deserialize(${{paramName}}, '{{#isContainer}}{{#items}}array<{{dataType}}>{{/items}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}', $inputFormat);
+ {{/isBodyParam}}
+ {{^isBodyParam}}
+ ${{paramName}} = $this->deserialize(${{paramName}}, '{{#isContainer}}array<{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}{{^collectionFormat}}csv{{/collectionFormat}},{{dataType}}>{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}', 'string');
+ {{/isBodyParam}}
+ {{/isFile}}
+ {{/allParams}}
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ {{/hasParams}}
+ // Validate the input values
+{{>api_input_validation}}
+
+ try {
+ $handler = $this->getApiHandler();
+
+ {{#authMethods}}
+ // Set authentication method '{{name}}'
+ $handler->set{{name}}($security{{name}});
+ {{/authMethods}}
+
+ // Make the call to the business logic
+ $responseCode = {{#returnType}}200{{/returnType}}{{^returnType}}204{{/returnType}};
+ $responseHeaders = [];
+ $result = $handler->{{operationId}}({{#allParams}}${{paramName}}, {{/allParams}}$responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '{{#responses}}{{#isDefault}}{{message}}{{/isDefault}}{{/responses}}';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ {{#responses}}
+ case {{code}}:
+ $message = '{{message}}';
+ break;
+ {{/responses}}
+ }
+
+ return new Response(
+ {{#returnType}}$result !== null ?$this->serialize($result, $responseFormat):''{{/returnType}}{{^returnType}}''{{/returnType}},
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ {{#returnType}}
+ 'Content-Type' => $responseFormat,
+ {{/returnType}}
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+ {{/operation}}
+
+ /**
+ * Returns the handler for this API controller.
+ * @return {{classname}}
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('{{pathPrefix}}');
+ }
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/api_doc.mustache
new file mode 100644
index 000000000000..b7416d19376b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/api_doc.mustache
@@ -0,0 +1,97 @@
+# {{apiPackage}}\{{classname}}{{#description}}
+{{description}}{{/description}}
+
+All URIs are relative to *{{basePath}}*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
+{{/operation}}{{/operations}}
+
+{{#operations}}
+## Service Declaration
+```yaml
+# src/Acme/MyBundle/Resources/services.yml
+services:
+ # ...
+ acme.my_bundle.api.{{pathPrefix}}:
+ class: Acme\MyBundle\Api\{{baseName}}Api
+ tags:
+ - { name: "{{bundleAlias}}.api", api: "{{pathPrefix}}" }
+ # ...
+```
+
+{{#operation}}
+## **{{{operationId}}}**
+> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
+
+{{{summary}}}{{#notes}}
+
+{{{notes}}}{{/notes}}
+
+### Example Implementation
+```php
+ {{maxLength}}
+ ]);
+ {{/maxLength}}
+ {{#minLength}}
+ $asserts[] = new Assert\Length([
+ 'min' => {{minLength}}
+ ]);
+ {{/minLength}}
+ {{#minimum}}
+ {{#exclusiveMinimum}}
+ $asserts[] = new Assert\GreaterThan({{minimum}});
+ {{/exclusiveMinimum}}
+ {{^exclusiveMinimum}}
+ $asserts[] = new Assert\GreaterThanOrEqual({{minimum}});
+ {{/exclusiveMinimum}}
+ {{/minimum}}
+ {{#maximum}}
+ {{#exclusiveMaximum}}
+ $asserts[] = new Assert\LessThan({{maximum}});
+ {{/exclusiveMaximum}}
+ {{^exclusiveMaximum}}
+ $asserts[] = new Assert\LessThanOrEqual({{maximum}});
+ {{/exclusiveMaximum}}
+ {{/maximum}}
+ {{#pattern}}
+ $asserts[] = new Assert\Regex("/{{pattern}}/");
+ {{/pattern}}
+ {{#maxItems}}
+ $asserts[] = new Assert\Count([
+ 'max' => {{maxItems}}
+ ]);
+ {{/maxItems}}
+ {{#minItems}}
+ $asserts[] = new Assert\Count([
+ 'min' => {{minItems}}
+ ]);
+ {{/minItems}}
+{{/hasValidation}}
+ $response = $this->validate(${{paramName}}, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+{{/allParams}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/autoload.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/autoload.mustache
new file mode 100644
index 000000000000..28ce32ae50a5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/autoload.mustache
@@ -0,0 +1,44 @@
+partial_header}}
+/**
+ * An example of a project-specific implementation.
+ *
+ * After registering this autoload function with SPL, the following line
+ * would cause the function to attempt to load the \{{invokerPackage}}\Baz\Qux class
+ * from /path/to/project/{{srcBasePath}}/Baz/Qux.php:
+ *
+ * new \{{invokerPackage}}\Baz\Qux;
+ *
+ * @param string $class The fully-qualified class name.
+ *
+ * @return void
+ */
+spl_autoload_register(function ($class) {
+
+ // project-specific namespace prefix
+ $prefix = '{{escapedInvokerPackage}}\\';
+
+ // base directory for the namespace prefix
+ $base_dir = __DIR__ . '/{{srcBasePath}}/';
+
+ // does the class use the namespace prefix?
+ $len = strlen($prefix);
+ if (strncmp($prefix, $class, $len) !== 0) {
+ // no, move to the next registered autoloader
+ return;
+ }
+
+ // get the relative class name
+ $relative_class = substr($class, $len);
+
+ // replace the namespace prefix with the base directory, replace namespace
+ // separators with directory separators in the relative class name, append
+ // with .php
+ $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
+
+ // if the file exists, require it
+ if (file_exists($file)) {
+ require $file;
+ }
+});
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/composer.mustache
new file mode 100644
index 000000000000..98f7e95306d8
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/composer.mustache
@@ -0,0 +1,90 @@
+{
+ "name": "{{gitUserId}}/{{gitRepoId}}",
+ "type": "project",
+ {{#artifactVersion}}
+ "version": "{{artifactVersion}}",
+ {{/artifactVersion}}
+ "description": "{{description}}",
+ "minimum-stability": "dev",
+ "keywords": [
+ "openapi",
+ "php",
+ "sdk",
+ "api"
+ ],
+ "homepage": "https://github.com/openapitools/openapi-generator",
+ "license": "unlicense",
+ "authors": [
+ {
+ "name": "openapi-generator contributors",
+ "homepage": "https://github.com/openapitools/openapi-generator"
+ }
+ ],
+ "require": {
+ "php": "^7.2.5",
+ "ext-ctype": "*",
+ "ext-iconv": "*",
+ "symfony/flex": "^1.3.1"
+ },
+ "flex-require": {
+ "symfony/console": "*",
+ "symfony/dotenv": "*",
+ "symfony/framework-bundle": "*",
+ "symfony/yaml": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0",
+ "friendsofphp/php-cs-fixer": "^2.16.3",
+ "symfony/browser-kit": "*",
+ "symfony/yaml": "^4.4.8",
+ "hoa/regex": "~1.0"
+ },
+ "config": {
+ "optimize-autoloader": true,
+ "preferred-install": {
+ "*": "dist"
+ },
+ "sort-packages": true
+ },
+ "autoload": {
+ "psr-4": {
+ "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "{{escapedInvokerPackage}}\\": "{{testsSrcPath}}/"
+ }
+ },
+ "replace": {
+ "paragonie/random_compat": "2.*",
+ "symfony/polyfill-ctype": "*",
+ "symfony/polyfill-iconv": "*",
+ "symfony/polyfill-php72": "*",
+ "symfony/polyfill-php71": "*",
+ "symfony/polyfill-php70": "*",
+ "symfony/polyfill-php56": "*"
+ },
+ "scripts": {
+ "auto-scripts": [
+ ],
+ "post-install-cmd": [
+ "@auto-scripts"
+ ],
+ "post-update-cmd": [
+ "@auto-scripts"
+ ]
+ },
+ "conflict": {
+ "symfony/symfony": "*"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.2-dev"
+ },
+ "symfony": {
+ "allow-contrib": false,
+ "require": "5.2.*"
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/git_push.sh.mustache
new file mode 100755
index 000000000000..8b3f689c9121
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/git_push.sh.mustache
@@ -0,0 +1,58 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="{{{gitHost}}}"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="{{{gitUserId}}}"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="{{{gitRepoId}}}"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="{{{releaseNote}}}"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/gitignore b/modules/openapi-generator/src/main/resources/php-symfony5-server/gitignore
new file mode 100644
index 000000000000..0bac519d3e84
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/gitignore
@@ -0,0 +1,68 @@
+# ref: https://github.com/github/gitignore/blob/master/Symfony.gitignore
+
+# Cache and logs (Symfony2)
+/app/cache/*
+/app/logs/*
+!app/cache/.gitkeep
+!app/logs/.gitkeep
+
+# Email spool folder
+/app/spool/*
+
+# Cache, session files and logs (Symfony3)
+/var/cache/*
+/var/logs/*
+/var/sessions/*
+!var/cache/.gitkeep
+!var/logs/.gitkeep
+!var/sessions/.gitkeep
+
+# Parameters
+/app/config/parameters.yml
+/app/config/parameters.ini
+
+# Managed by Composer
+/app/bootstrap.php.cache
+/var/bootstrap.php.cache
+/bin/*
+!bin/console
+!bin/symfony_requirements
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+composer.lock
+
+# Assets and user uploads
+/web/bundles/
+/web/uploads/
+
+# PHPUnit
+/app/phpunit.xml
+/phpunit.xml
+
+# Build data
+/build/
+
+# Composer PHAR
+/composer.phar
+
+# Backup entities generated with doctrine:generate:entities command
+**/Entity/*~
+
+# Embedded web-server pid file
+/.web-server-pid
+
+# From root gitignore
+/Tests/cache/
+/Tests/logs/
+
+# PHP Coding Standards Fixer
+# https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md#config-file
+# From now you can create new configuration file: .php_cs.dist.
+# This file is used if no .php_cs file was found.
+# It is recommended to create .php_cs.dist file attached in your repository and add .php_cs file to .gitignore for allowing your contributors to have theirs own configuration file.
+/.php_cs
+
+# No reason to commit PHP CS Fixer cache files
+/.php_cs.cache
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/model.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/model.mustache
new file mode 100644
index 000000000000..12959e5101c6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/model.mustache
@@ -0,0 +1,39 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Do not edit the class manually.
+ */
+
+namespace {{modelPackage}};
+
+use Symfony\Component\Validator\Constraints as Assert;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\SerializedName;
+
+/**
+ * Class representing the {{classname}} model.
+ *
+{{#description}}
+ * {{description}}
+ *
+{{/description}}
+ * @package {{modelPackage}}
+ * @author OpenAPI Generator team
+ */
+{{>model_generic}}
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/model_doc.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_doc.mustache
new file mode 100644
index 000000000000..71c106fdc55d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_doc.mustache
@@ -0,0 +1,11 @@
+{{#models}}{{#model}}# {{classname}}
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
+{{/vars}}
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/model_enum.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_enum.mustache
new file mode 100644
index 000000000000..5e6b2aea2157
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_enum.mustache
@@ -0,0 +1,19 @@
+class {{classname}}
+{
+ /**
+ * Possible values of this enum
+ */
+ {{#allowableValues}}{{#enumVars}}const {{{name}}} = {{{value}}};
+ {{/enumVars}}{{/allowableValues}}
+ /**
+ * Gets allowable values of the enum
+ * @return string[]
+ */
+ public static function getAllowableEnumValues()
+ {
+ return [
+ {{#allowableValues}}{{#enumVars}}self::{{{name}}},{{^-last}}
+ {{/-last}}{{/enumVars}}{{/allowableValues}}
+ ];
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_generic.mustache
new file mode 100644
index 000000000000..54b34b9f903d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_generic.mustache
@@ -0,0 +1,45 @@
+class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
+{
+ {{#vars}}{{>model_variables}}
+ {{/vars}}
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ {{#parentSchema}}
+ parent::__construct($data);
+
+ {{/parentSchema}}
+ {{#vars}}
+ $this->{{name}} = isset($data['{{name}}']) ? $data['{{name}}'] : {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}};
+ {{/vars}}
+ }
+ {{#vars}}
+
+ /**
+ * Gets {{name}}.
+ *
+ * @return {{{vendorExtensions.x-comment-type}}}{{^required}}|null{{/required}}
+ */
+ public function {{getter}}(){{#vendorExtensions.x-parameter-type}}: {{^required}}?{{/required}}{{vendorExtensions.x-parameter-type}}{{/vendorExtensions.x-parameter-type}}
+ {
+ return $this->{{name}};
+ }
+
+ /**
+ * Sets {{name}}.
+ *
+ * @param {{{vendorExtensions.x-comment-type}}}{{^required}}|null{{/required}} ${{name}}{{#description}} {{{description}}}{{/description}}
+ *
+ * @return $this
+ */
+ public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}})
+ {
+ $this->{{name}} = ${{name}};
+
+ return $this;
+ }
+ {{/vars}}
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/model_variables.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_variables.mustache
new file mode 100644
index 000000000000..38959f360eb2
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/model_variables.mustache
@@ -0,0 +1,98 @@
+ /**
+ {{#description}}
+ * {{description}}
+ *
+ {{/description}}
+ * @var {{{vendorExtensions.x-comment-type}}}{{^required}}|null{{/required}}
+ * @SerializedName("{{baseName}}")
+{{#required}}
+ * @Assert\NotNull()
+{{/required}}
+{{#isEnum}}
+ {{#isContainer}}
+ * @Assert\All({
+ {{#items}}
+ * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
+ {{/items}}
+ * })
+ {{/isContainer}}
+ {{^isContainer}}
+ * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
+ {{/isContainer}}
+{{/isEnum}}
+{{#isContainer}}
+ * @Assert\All({
+ {{#items}}
+ * @Assert\Type("{{dataType}}")
+ {{/items}}
+ * })
+ {{#isMapContainer}}
+ {{#items}}
+ * @Type("array")
+ {{/items}}
+ {{/isMapContainer}}
+ {{^isMapContainer}}
+ {{#items}}
+ * @Type("array<{{dataType}}>")
+ {{/items}}
+ {{/isMapContainer}}
+{{/isContainer}}
+{{^isContainer}}
+ {{#isDate}}
+ * @Assert\Date()
+ * @Type("DateTime")
+ {{/isDate}}
+ {{#isDateTime}}
+ * @Assert\DateTime()
+ * @Type("DateTime")
+ {{/isDateTime}}
+ {{^isDate}}
+ {{^isDateTime}}
+ * @Assert\Type("{{dataType}}")
+ * @Type("{{dataType}}")
+ {{/isDateTime}}
+ {{/isDate}}
+{{/isContainer}}
+{{#hasValidation}}
+ {{#maxLength}}
+ * @Assert\Length(
+ * max = {{maxLength}}
+ * )
+ {{/maxLength}}
+ {{#minLength}}
+ * @Assert\Length(
+ * min = {{minLength}}
+ * )
+ {{/minLength}}
+ {{#minimum}}
+ {{#exclusiveMinimum}}
+ * @Assert\GreaterThan({{minimum}})
+ {{/exclusiveMinimum}}
+ {{^exclusiveMinimum}}
+ * @Assert\GreaterThanOrEqual({{minimum}})
+ {{/exclusiveMinimum}}
+ {{/minimum}}
+ {{#maximum}}
+ {{#exclusiveMaximum}}
+ * @Assert\LessThan({{minimum}})
+ {{/exclusiveMaximum}}
+ {{^exclusiveMaximum}}
+ * @Assert\LessThanOrEqual({{minimum}})
+ {{/exclusiveMaximum}}
+ {{/maximum}}
+ {{#pattern}}
+ * @Assert\Regex("/{{pattern}}/")
+ {{/pattern}}
+ {{#maxItems}}
+ * @Assert\Count(
+ * max = {{maxItems}}
+ * )
+ {{/maxItems}}
+ {{#minItems}}
+ * @Assert\Count(
+ * min = {{minItems}}
+ * )
+ {{/minItems}}
+{{/hasValidation}}
+ */
+ protected ${{name}};
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/partial_header.mustache
new file mode 100644
index 000000000000..5d5b3fb25161
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/partial_header.mustache
@@ -0,0 +1,14 @@
+/**
+ {{#appName}}
+ * {{{appName}}}
+ *
+ {{/appName}}
+ {{#appDescription}}
+ * {{{appDescription}}}
+ *
+ {{/appDescription}}
+ * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
+ * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ *
+ */
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/routing.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/routing.mustache
new file mode 100644
index 000000000000..0b9ec9291458
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/routing.mustache
@@ -0,0 +1,41 @@
+# NOTE: This file is auto generated by the openapi generator program.
+# https://github.com/openapitools/openapi-generator
+# Do not edit the class manually.
+
+{{#apiInfo}}
+{{#apis}}
+{{#operations}}
+# {{pathPrefix}}
+{{#operation}}
+{{bundleAlias}}_{{pathPrefix}}_{{operationIdLowerCase}}:
+ path: {{path}}
+ methods: [{{httpMethod}}]
+ defaults:
+ _controller: {{bundleAlias}}.controller.{{pathPrefix}}:{{operationId}}Action
+ {{#hasPathParams}}
+ requirements:
+ {{/hasPathParams}}
+ {{#pathParams}}
+ {{#pattern}}
+ {{paramName}}: '{{pattern}}'
+ {{/pattern}}
+ {{^pattern}}
+ {{#isLong}}
+ {{paramName}}: '\d+'
+ {{/isLong}}
+ {{#isInteger}}
+ {{paramName}}: '\d+'
+ {{/isInteger}}
+ {{#isString}}
+ {{paramName}}: '[a-z0-9]+'
+ {{/isString}}
+ {{#isBoolean}}
+ {{paramName}}: 'true|false'
+ {{/isBoolean}}
+ {{/pattern}}
+ {{/pathParams}}
+
+{{/operation}}
+{{/operations}}
+{{/apis}}
+{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/JmsSerializer.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/JmsSerializer.mustache
new file mode 100644
index 000000000000..e4e7c96499bc
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/JmsSerializer.mustache
@@ -0,0 +1,115 @@
+serializer = SerializerBuilder::create()
+ ->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy))
+ ->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy))
+ ->build();
+ }
+
+ public function serialize($data, $format)
+ {
+ return SerializerBuilder::create()->build()->serialize($data, $this->convertFormat($format));
+ }
+
+ public function deserialize($data, $type, $format)
+ {
+ if ($format == 'string') {
+ return $this->deserializeString($data, $type);
+ }
+
+ // If we end up here, let JMS serializer handle the deserialization
+ return $this->serializer->deserialize($data, $type, $this->convertFormat($format));
+ }
+
+ private function convertFormat($format)
+ {
+ switch ($format) {
+ case 'application/json':
+ return 'json';
+ case 'application/xml':
+ return 'xml';
+ }
+
+ return null;
+ }
+
+ private function deserializeString($data, $type)
+ {
+ // Figure out if we have an array format
+ if (1 === preg_match('/array<(csv|ssv|tsv|pipes),(int|string)>/i', $type, $matches)) {
+ return $this->deserializeArrayString($matches[1], $matches[2], $data);
+ }
+
+ switch ($type) {
+ case 'int':
+ case 'integer':
+ if (is_int($data)) {
+ return $data;
+ }
+
+ if (is_numeric($data)) {
+ return $data + 0;
+ }
+
+ break;
+ case 'string':
+ break;
+ case 'boolean':
+ case 'bool':
+ if (strtolower($data) === 'true') {
+ return true;
+ }
+
+ if (strtolower($data) === 'false') {
+ return false;
+ }
+
+ break;
+ }
+
+ // If we end up here, just return data
+ return $data;
+ }
+
+ private function deserializeArrayString($format, $type, $data)
+ {
+ // Parse the string using the correct separator
+ switch ($format) {
+ case 'csv':
+ $data = explode(',', $data);
+ break;
+ case 'ssv':
+ $data = explode(' ', $data);
+ break;
+ case 'tsv':
+ $data = explode("\t", $data);
+ break;
+ case 'pipes':
+ $data = explode('|', $data);
+ break;
+ default;
+ $data = [];
+ }
+
+ // Deserialize each of the array elements
+ foreach ($data as $key => $item) {
+ $data[$key] = $this->deserializeString($item, $type);
+ }
+
+ return $data;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/SerializerInterface.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/SerializerInterface.mustache
new file mode 100644
index 000000000000..60ad87246487
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/serialization/SerializerInterface.mustache
@@ -0,0 +1,27 @@
+getCurrentPath()) > 0) {
+ $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath()));
+ } else {
+ $property = '';
+ }
+
+ return new static(sprintf(
+ 'Expected %s%s, but got %s: %s',
+ $property,
+ $expected_type,
+ gettype($actual_value),
+ json_encode($actual_value)
+ ));
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/services.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/services.mustache
new file mode 100644
index 000000000000..1432b4a82a93
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/services.mustache
@@ -0,0 +1,38 @@
+# NOTE: This file is auto generated by the openapi generator program.
+# https://github.com/openapitools/openapi-generator
+# Do not edit the class manually.
+
+parameters:
+ {{bundleAlias}}.serializer: '{{servicePackage}}\JmsSerializer'
+ {{bundleAlias}}.validator: '{{servicePackage}}\SymfonyValidator'
+
+services:
+ {{bundleAlias}}.api.api_server:
+ class: {{apiPackage}}\ApiServer
+
+ {{bundleAlias}}.model.model_serializer:
+ class: {{modelPackage}}\ModelSerializer
+
+ {{bundleAlias}}.service.serializer:
+ class: '%{{bundleAlias}}.serializer%'
+
+ {{bundleAlias}}.service.validator:
+ class: '%{{bundleAlias}}.validator%'
+ arguments:
+ - '@validator'
+
+{{#apiInfo}}
+{{#apis}}
+{{#operations}}
+ {{bundleAlias}}.controller.{{pathPrefix}}:
+ class: {{controllerPackage}}\{{baseName}}Controller
+ calls:
+ - [setSerializer, ['@{{bundleAlias}}.service.serializer']]
+ - [setValidator, ['@{{bundleAlias}}.service.validator']]
+ - [setApiServer, ['@{{bundleAlias}}.api.api_server']]
+ tags: ['controller.service_arguments']
+ autowire: true
+
+{{/operations}}
+{{/apis}}
+{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/AppKernel.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/AppKernel.mustache
new file mode 100644
index 000000000000..617189baa7a5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/AppKernel.mustache
@@ -0,0 +1,24 @@
+load(__DIR__.'/test_config.yml');
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/ControllerTest.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/ControllerTest.mustache
new file mode 100644
index 000000000000..49861fd96722
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/ControllerTest.mustache
@@ -0,0 +1,113 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Please update the test case below to test the endpoint.
+ */
+
+namespace {{controllerTestsPackage}};
+
+use {{controllerPackage}}\Controller;
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * ControllerTest Class Doc Comment
+ *
+ * @category Class
+ * @package {{controllerTestsPackage}}
+ * @author openapi-generator contributors
+ * @link https://github.com/openapitools/openapi-generator
+ * @coversDefaultClass \{{controllerPackage}}\Controller
+ */
+class ControllerTest extends TestCase
+{
+
+ /**
+ * Tests isContentTypeAllowed static method.
+ *
+ * @param string $contentType
+ * @param array $consumes
+ * @param bool $expectedReturn
+ *
+ * @covers ::isContentTypeAllowed
+ * @dataProvider provideArgumentsForIsContentTypeAllowed
+ */
+ public function testIsContentTypeAllowed($contentType, array $consumes, $expectedReturn)
+ {
+ $request = new Request();
+ $request->headers->set('CONTENT_TYPE', $contentType, true);// last one argument overrides header
+ $this->assertSame(
+ $expectedReturn,
+ Controller::isContentTypeAllowed($request, $consumes),
+ sprintf(
+ 'Failed assertion that "Content-Type: %s" %s by [%s] consumes array.',
+ $contentType,
+ ($expectedReturn) ? 'is allowed' : 'is forbidden',
+ implode(', ', $consumes)
+ )
+ );
+ }
+
+ public function provideArgumentsForIsContentTypeAllowed()
+ {
+ return [
+ 'usual JSON content type' => [
+ 'application/json',
+ ['application/json'],
+ true,
+ ],
+ 'extended content type from PR #6078' => [
+ 'application/json; charset=utf-8',
+ ['application/json'],
+ true,
+ ],
+ 'more than one content types' => [
+ 'application/json',
+ ['application/xml', 'application/json; charset=utf-8'],
+ true,
+ ],
+ 'empty consumes array' => [
+ 'application/json',
+ [],
+ true,
+ ],
+ 'empty consumes and content type' => [
+ null,
+ [],
+ true,
+ ],
+ 'consumes everything' => [
+ 'application/json',
+ ['*/*'],
+ true,
+ ],
+ 'fancy custom content type' => [
+ 'foobar/foobaz',
+ ['application/xml', 'foobar/foobaz; charset=utf-8'],
+ true,
+ ],
+ 'empty content type' => [
+ null,
+ ['application/xml', 'application/json; charset=utf-8'],
+ false,
+ ],
+ 'content type out of consumes' => [
+ 'text/html',
+ ['application/xml', 'application/json; charset=utf-8'],
+ false,
+ ],
+ ];
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/api_test.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/api_test.mustache
new file mode 100644
index 000000000000..61f6c3f89f9b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/api_test.mustache
@@ -0,0 +1,116 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Please update the test case below to test the endpoint.
+ */
+
+namespace {{apiTestsPackage}};
+
+use {{invokerPackage}}\Configuration;
+use {{invokerPackage}}\ApiClient;
+use {{invokerPackage}}\ApiException;
+use {{invokerPackage}}\ObjectSerializer;
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
+
+/**
+ * {{classname}}Test Class Doc Comment
+ *
+ * @category Class
+ * @package {{apiTestsPackage}}
+ * @author openapi-generator contributors
+ * @link https://github.com/openapitools/openapi-generator
+ */
+{{#operations}}class {{classname}}Test extends WebTestCase
+{
+
+ /**
+ * Setup before running any test cases
+ */
+ public static function setUpBeforeClass()
+ {
+ }
+
+ /**
+ * Setup before running each test case
+ */
+ public function setUp()
+ {
+ }
+
+ /**
+ * Clean up after running each test case
+ */
+ public function tearDown()
+ {
+ }
+
+ /**
+ * Clean up after running all test cases
+ */
+ public static function tearDownAfterClass()
+ {
+ }
+ {{#operation}}
+
+ /**
+ * Test case for {{{operationId}}}
+ *
+ * {{{summary}}}.
+ *
+ */
+ public function test{{operationIdCamelCase}}()
+ {
+ $client = static::createClient();
+
+ $path = '{{path}}';
+ {{#pathParams}}
+ {{=<% %>=}}
+ $pattern = '{<%paramName%>}';
+ <%={{ }}=%>
+ {{#pattern}}
+ $data = $this->genTestData('{{pattern}}');
+ {{/pattern}}
+ {{^pattern}}
+ {{#isLong}}
+ $data = $this->genTestData('\d+');
+ {{/isLong}}
+ {{#isInteger}}
+ $data = $this->genTestData('\d+');
+ {{/isInteger}}
+ {{#isString}}
+ $data = $this->genTestData('[a-z0-9]+');
+ {{/isString}}
+ {{#isBoolean}}
+ $data = $this->genTestData('true|false');
+ {{/isBoolean}}
+ {{/pattern}}
+ $path = str_replace($pattern, $data, $path);
+ {{/pathParams}}
+
+ $crawler = $client->request('{{httpMethod}}', $path{{#hasBodyParam}}, [], [], ['CONTENT_TYPE' => 'application/json']{{/hasBodyParam}});
+ }
+ {{/operation}}
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/model_test.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/model_test.mustache
new file mode 100644
index 000000000000..bdeac9ab8050
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/model_test.mustache
@@ -0,0 +1,85 @@
+partial_header}}
+/**
+ * NOTE: This class is auto generated by the openapi generator program.
+ * https://github.com/openapitools/openapi-generator
+ * Please update the test case below to test the model.
+ */
+
+namespace {{modelPackage}};
+
+use PHPUnit\Framework\TestCase;
+
+/**
+ * {{classname}}Test Class Doc Comment
+ *
+ * @category Class */
+// * @description {{#description}}{{description}}{{/description}}{{^description}}{{classname}}{{/description}}
+/**
+ * @package {{modelTestsPackage}}
+ * @author openapi-generator contributors
+ * @link https://github.com/openapitools/openapi-generator
+ */
+class {{classname}}Test extends TestCase
+{
+
+ /**
+ * Setup before running any test case
+ */
+ public static function setUpBeforeClass()
+ {
+ }
+
+ /**
+ * Setup before running each test case
+ */
+ public function setUp()
+ {
+ }
+
+ /**
+ * Clean up after running each test case
+ */
+ public function tearDown()
+ {
+ }
+
+ /**
+ * Clean up after running all test cases
+ */
+ public static function tearDownAfterClass()
+ {
+ }
+
+ /**
+ * Test "{{classname}}"
+ */
+ public function test{{classname}}()
+ {
+ $test{{classname}} = new {{classname}}();
+ }
+{{#vars}}
+
+ /**
+ * Test attribute "{{name}}"
+ */
+ public function testProperty{{nameInCamelCase}}()
+ {
+ }
+{{/vars}}
+}
+{{/model}}
+{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/phpunit.xml.mustache
new file mode 100644
index 000000000000..3c46ece5012f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/phpunit.xml.mustache
@@ -0,0 +1,26 @@
+
+
+
+
+ {{apiTestPath}}
+ {{modelTestPath}}
+ {{controllerTestPath}}
+
+
+
+
+ {{apiSrcPath}}
+ {{modelSrcPath}}
+ {{controllerSrcPath}}
+
+
+
+
+
+
+
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/pom.xml b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/pom.xml
new file mode 100644
index 000000000000..672956a1b516
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/pom.xml
@@ -0,0 +1,57 @@
+
+ 4.0.0
+ com.penneo
+ PhpSymfonyPetstoreServerTests
+ pom
+ 1.0-SNAPSHOT
+ PHP Symfony Petstore Server
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.2.1
+
+
+ bundle-install
+ pre-integration-test
+
+ exec
+
+
+ composer
+
+ install
+
+
+
+
+ bundle-test
+ integration-test
+
+ exec
+
+
+ vendor/bin/phpunit
+
+
+
+
+
+
+
+
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/test_config.yml b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/test_config.yml
new file mode 100644
index 000000000000..10c88a274c97
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/testing/test_config.yml
@@ -0,0 +1,8 @@
+imports:
+ - { resource: "../Resources/config/services.yml" }
+
+framework:
+ secret: "testsecret"
+ test: ~
+ router:
+ resource: "%kernel.root_dir%/../Resources/config/routing.yml"
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/SymfonyValidator.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/SymfonyValidator.mustache
new file mode 100644
index 000000000000..1ec3b80ce174
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/SymfonyValidator.mustache
@@ -0,0 +1,20 @@
+validator = $validator;
+ }
+
+ public function validate($value, $constraints = null, $groups = null)
+ {
+ return $this->validator->validate($value, $constraints, $groups);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/ValidatorInterface.mustache b/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/ValidatorInterface.mustache
new file mode 100644
index 000000000000..e2a0d9badc5d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/php-symfony5-server/validation/ValidatorInterface.mustache
@@ -0,0 +1,25 @@
+ createOptions() {
+ ImmutableMap.Builder builder = new ImmutableMap.Builder();
+ return builder.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
+ .put(AbstractPhpCodegen.VARIABLE_NAMING_CONVENTION, VARIABLE_NAMING_CONVENTION_VALUE)
+ .put(AbstractPhpCodegen.PACKAGE_NAME, PACKAGE_NAME_VALUE)
+ .put(AbstractPhpCodegen.SRC_BASE_PATH, SRC_BASE_PATH_VALUE)
+ .put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
+ .put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
+ .put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
+ .put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
+ .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE)
+ .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
+ .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
+ .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
+ .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true")
+ .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true")
+ .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, HIDE_GENERATION_TIMESTAMP_VALUE)
+ .put(PhpSymfonyServerCodegen.BUNDLE_NAME, BUNDLE_NAME_VALUE)
+ .put(PhpSymfonyServerCodegen.BUNDLE_ALIAS, BUNDLE_ALIAS_VALUE)
+ .put(PhpSymfonyServerCodegen.COMPOSER_VENDOR_NAME, COMPOSER_VENDOR_NAME_VALUE)
+ .put(PhpSymfonyServerCodegen.COMPOSER_PROJECT_NAME, COMPOSER_PROJECT_NAME_VALUE)
+ .build();
+ }
+
+ @Override
+ public boolean isServer() {
+ return true;
+ }
+}
+
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerCodegenTest.java
new file mode 100644
index 000000000000..f66122f70d16
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerCodegenTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.php;
+
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.languages.PhpSymfony5ServerCodegen;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class PhpSymfony5ServerCodegenTest {
+
+ @Test
+ public void testInitialConfigValues() throws Exception {
+ final PhpSymfony5ServerCodegen codegen = new PhpSymfony5ServerCodegen();
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), true);
+ }
+
+ @Test
+ public void testSettersForConfigValues() throws Exception {
+ final PhpSymfony5ServerCodegen codegen = new PhpSymfony5ServerCodegen();
+ codegen.setHideGenerationTimestamp(false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+
+ @Test
+ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
+ final PhpSymfony5ServerCodegen codegen = new PhpSymfony5ServerCodegen();
+ codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerOptionsTest.java
new file mode 100644
index 000000000000..e539126bc0ee
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpSymfony5ServerOptionsTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ * Copyright 2018 SmartBear Software
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.php;
+
+import org.openapitools.codegen.AbstractOptionsTest;
+import org.openapitools.codegen.CodegenConfig;
+import org.openapitools.codegen.languages.PhpSymfony5ServerCodegen;
+import org.openapitools.codegen.options.PhpSymfony5ServerOptionsProvider;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class PhpSymfony5ServerOptionsTest extends AbstractOptionsTest {
+ private PhpSymfony5ServerCodegen codegen = mock(PhpSymfony5ServerCodegen.class, mockSettings);
+
+ public PhpSymfony5ServerOptionsTest() {
+ super(new PhpSymfony5ServerOptionsProvider());
+ }
+
+ @Override
+ protected CodegenConfig getCodegenConfig() {
+ return codegen;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ protected void verifyOptions() {
+ verify(codegen).setModelPackage(PhpSymfony5ServerOptionsProvider.MODEL_PACKAGE_VALUE);
+ verify(codegen).setApiPackage(PhpSymfony5ServerOptionsProvider.API_PACKAGE_VALUE);
+ verify(codegen).setParameterNamingConvention(PhpSymfony5ServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE);
+ verify(codegen).setInvokerPackage(PhpSymfony5ServerOptionsProvider.INVOKER_PACKAGE_VALUE);
+ verify(codegen).setPackageName(PhpSymfony5ServerOptionsProvider.PACKAGE_NAME_VALUE);
+ verify(codegen).setSrcBasePath(PhpSymfony5ServerOptionsProvider.SRC_BASE_PATH_VALUE);
+ verify(codegen).setArtifactVersion(PhpSymfony5ServerOptionsProvider.ARTIFACT_VERSION_VALUE);
+ verify(codegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSymfony5ServerOptionsProvider.SORT_PARAMS_VALUE));
+ verify(codegen).setHideGenerationTimestamp(Boolean.valueOf(PhpSymfony5ServerOptionsProvider.HIDE_GENERATION_TIMESTAMP_VALUE));
+ verify(codegen).setBundleName(PhpSymfony5ServerOptionsProvider.BUNDLE_NAME_VALUE);
+ verify(codegen).setBundleAlias(PhpSymfony5ServerOptionsProvider.BUNDLE_ALIAS_VALUE);
+ verify(codegen).setComposerVendorName(PhpSymfony5ServerOptionsProvider.COMPOSER_VENDOR_NAME_VALUE);
+ verify(codegen).setComposerProjectName(PhpSymfony5ServerOptionsProvider.COMPOSER_PROJECT_NAME_VALUE);
+ }
+}
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator-ignore b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/FILES b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/FILES
new file mode 100644
index 000000000000..f034bc362a15
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/FILES
@@ -0,0 +1,177 @@
+Api/AnotherFakeApiInterface.php
+Api/DefaultApiInterface.php
+Api/FakeApiInterface.php
+Api/FakeClassnameTags123ApiInterface.php
+Api/PetApiInterface.php
+Api/StoreApiInterface.php
+Api/UserApiInterface.php
+Controller/AnotherFakeController.php
+Controller/DefaultController.php
+Controller/FakeClassnameTags123Controller.php
+Controller/FakeController.php
+Controller/PetController.php
+Controller/StoreController.php
+Controller/UserController.php
+Model/AdditionalPropertiesClass.php
+Model/Animal.php
+Model/ApiResponse.php
+Model/ArrayOfArrayOfNumberOnly.php
+Model/ArrayOfNumberOnly.php
+Model/ArrayTest.php
+Model/Capitalization.php
+Model/Cat.php
+Model/CatAllOf.php
+Model/Category.php
+Model/ClassModel.php
+Model/Client.php
+Model/Dog.php
+Model/DogAllOf.php
+Model/EnumArrays.php
+Model/EnumClass.php
+Model/EnumTest.php
+Model/File.php
+Model/FileSchemaTestClass.php
+Model/Foo.php
+Model/FormatTest.php
+Model/HasOnlyReadOnly.php
+Model/HealthCheckResult.php
+Model/InlineObject.php
+Model/InlineObject1.php
+Model/InlineObject2.php
+Model/InlineObject3.php
+Model/InlineObject4.php
+Model/InlineObject5.php
+Model/InlineResponseDefault.php
+Model/MapTest.php
+Model/MixedPropertiesAndAdditionalPropertiesClass.php
+Model/Model200Response.php
+Model/ModelList.php
+Model/ModelReturn.php
+Model/Name.php
+Model/NullableClass.php
+Model/NumberOnly.php
+Model/Order.php
+Model/OuterComposite.php
+Model/OuterEnum.php
+Model/OuterEnumDefaultValue.php
+Model/OuterEnumInteger.php
+Model/OuterEnumIntegerDefaultValue.php
+Model/Pet.php
+Model/ReadOnlyFirst.php
+Model/SpecialModelName.php
+Model/Tag.php
+Model/User.php
+Tests/Api/AnotherFakeApiInterfaceTest.php
+Tests/Api/DefaultApiInterfaceTest.php
+Tests/Api/FakeApiInterfaceTest.php
+Tests/Api/FakeClassnameTags123ApiInterfaceTest.php
+Tests/Api/PetApiInterfaceTest.php
+Tests/Api/StoreApiInterfaceTest.php
+Tests/Api/UserApiInterfaceTest.php
+Tests/Model/AdditionalPropertiesClassTest.php
+Tests/Model/AnimalTest.php
+Tests/Model/ApiResponseTest.php
+Tests/Model/ArrayOfArrayOfNumberOnlyTest.php
+Tests/Model/ArrayOfNumberOnlyTest.php
+Tests/Model/ArrayTestTest.php
+Tests/Model/CapitalizationTest.php
+Tests/Model/CatAllOfTest.php
+Tests/Model/CatTest.php
+Tests/Model/CategoryTest.php
+Tests/Model/ClassModelTest.php
+Tests/Model/ClientTest.php
+Tests/Model/DogAllOfTest.php
+Tests/Model/DogTest.php
+Tests/Model/EnumArraysTest.php
+Tests/Model/EnumClassTest.php
+Tests/Model/EnumTestTest.php
+Tests/Model/FileSchemaTestClassTest.php
+Tests/Model/FileTest.php
+Tests/Model/FooTest.php
+Tests/Model/FormatTestTest.php
+Tests/Model/HasOnlyReadOnlyTest.php
+Tests/Model/HealthCheckResultTest.php
+Tests/Model/InlineObject1Test.php
+Tests/Model/InlineObject2Test.php
+Tests/Model/InlineObject3Test.php
+Tests/Model/InlineObject4Test.php
+Tests/Model/InlineObject5Test.php
+Tests/Model/InlineObjectTest.php
+Tests/Model/InlineResponseDefaultTest.php
+Tests/Model/MapTestTest.php
+Tests/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php
+Tests/Model/Model200ResponseTest.php
+Tests/Model/ModelListTest.php
+Tests/Model/ModelReturnTest.php
+Tests/Model/NameTest.php
+Tests/Model/NullableClassTest.php
+Tests/Model/NumberOnlyTest.php
+Tests/Model/OrderTest.php
+Tests/Model/OuterCompositeTest.php
+Tests/Model/OuterEnumDefaultValueTest.php
+Tests/Model/OuterEnumIntegerDefaultValueTest.php
+Tests/Model/OuterEnumIntegerTest.php
+Tests/Model/OuterEnumTest.php
+Tests/Model/PetTest.php
+Tests/Model/ReadOnlyFirstTest.php
+Tests/Model/SpecialModelNameTest.php
+Tests/Model/TagTest.php
+Tests/Model/UserTest.php
+.openapi-generator-ignore
+Resources/docs/Api/AnotherFakeApiInterface.md
+Resources/docs/Api/DefaultApiInterface.md
+Resources/docs/Api/FakeApiInterface.md
+Resources/docs/Api/FakeClassnameTags123ApiInterface.md
+Resources/docs/Api/PetApiInterface.md
+Resources/docs/Api/StoreApiInterface.md
+Resources/docs/Api/UserApiInterface.md
+Resources/docs/Model/AdditionalPropertiesClass.md
+Resources/docs/Model/Animal.md
+Resources/docs/Model/ApiResponse.md
+Resources/docs/Model/ArrayOfArrayOfNumberOnly.md
+Resources/docs/Model/ArrayOfNumberOnly.md
+Resources/docs/Model/ArrayTest.md
+Resources/docs/Model/Capitalization.md
+Resources/docs/Model/Cat.md
+Resources/docs/Model/CatAllOf.md
+Resources/docs/Model/Category.md
+Resources/docs/Model/ClassModel.md
+Resources/docs/Model/Client.md
+Resources/docs/Model/Dog.md
+Resources/docs/Model/DogAllOf.md
+Resources/docs/Model/EnumArrays.md
+Resources/docs/Model/EnumClass.md
+Resources/docs/Model/EnumTest.md
+Resources/docs/Model/File.md
+Resources/docs/Model/FileSchemaTestClass.md
+Resources/docs/Model/Foo.md
+Resources/docs/Model/FormatTest.md
+Resources/docs/Model/HasOnlyReadOnly.md
+Resources/docs/Model/HealthCheckResult.md
+Resources/docs/Model/InlineObject.md
+Resources/docs/Model/InlineObject1.md
+Resources/docs/Model/InlineObject2.md
+Resources/docs/Model/InlineObject3.md
+Resources/docs/Model/InlineObject4.md
+Resources/docs/Model/InlineObject5.md
+Resources/docs/Model/InlineResponseDefault.md
+Resources/docs/Model/MapTest.md
+Resources/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md
+Resources/docs/Model/Model200Response.md
+Resources/docs/Model/ModelList.md
+Resources/docs/Model/ModelReturn.md
+Resources/docs/Model/Name.md
+Resources/docs/Model/NullableClass.md
+Resources/docs/Model/NumberOnly.md
+Resources/docs/Model/Order.md
+Resources/docs/Model/OuterComposite.md
+Resources/docs/Model/OuterEnum.md
+Resources/docs/Model/OuterEnumDefaultValue.md
+Resources/docs/Model/OuterEnumInteger.md
+Resources/docs/Model/OuterEnumIntegerDefaultValue.md
+Resources/docs/Model/Pet.md
+Resources/docs/Model/ReadOnlyFirst.md
+Resources/docs/Model/SpecialModelName.md
+Resources/docs/Model/Tag.md
+Resources/docs/Model/User.md
+composer.json
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/VERSION
new file mode 100644
index 000000000000..d99e7162d01f
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/.openapi-generator/VERSION
@@ -0,0 +1 @@
+5.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Api/AnotherFakeApiInterface.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Api/AnotherFakeApiInterface.php
new file mode 100644
index 000000000000..0e1f35431022
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Api/AnotherFakeApiInterface.php
@@ -0,0 +1,58 @@
+headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $client = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $client = $this->deserialize($client, 'OpenAPI\Server\Model\Client', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Client");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($client, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->call123TestSpecialTags($client, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return AnotherFakeApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('anotherFake');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/DefaultController.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/DefaultController.php
new file mode 100644
index 000000000000..d24cb34bec80
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/DefaultController.php
@@ -0,0 +1,121 @@
+headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Validate the input values
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fooGet($responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = 'response';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 0:
+ $message = 'response';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return DefaultApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('default');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeClassnameTags123Controller.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeClassnameTags123Controller.php
new file mode 100644
index 000000000000..3f59fb814158
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeClassnameTags123Controller.php
@@ -0,0 +1,152 @@
+headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'api_key_query' required
+ // Set key with prefix in query string
+ $securityapi_key_query = $request->query->get('api_key_query');
+
+ // Read out all input parameter values into variables
+ $client = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $client = $this->deserialize($client, 'OpenAPI\Server\Model\Client', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Client");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($client, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'api_key_query'
+ $handler->setapi_key_query($securityapi_key_query);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->testClassname($client, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return FakeClassnameTags123ApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('fakeClassnameTags123');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeController.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeController.php
new file mode 100644
index 000000000000..47aabb4e0866
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/FakeController.php
@@ -0,0 +1,1533 @@
+headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Validate the input values
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fakeHealthGet($responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'The instance started successfully';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation fakeHttpSignatureTest
+ *
+ * test http signature authentication
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function fakeHttpSignatureTestAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json', 'application/xml'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+ // Authentication 'http_signature_test' required
+ // HTTP basic authentication required
+ $securityhttp_signature_test = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $query1 = $request->query->get('query1');
+ $header1 = $request->headers->get('header_1');
+ $pet = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat);
+ $query1 = $this->deserialize($query1, 'string', 'string');
+ $header1 = $this->deserialize($header1, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($pet, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($query1, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($header1, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'http_signature_test'
+ $handler->sethttp_signature_test($securityhttp_signature_test);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->fakeHttpSignatureTest($pet, $query1, $header1, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'The instance started successfully';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation fakeOuterBooleanSerialize
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function fakeOuterBooleanSerializeAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['*/*'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $body = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $body = $this->deserialize($body, 'bool', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\Type("bool");
+ $response = $this->validate($body, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fakeOuterBooleanSerialize($body, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Output boolean';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation fakeOuterCompositeSerialize
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function fakeOuterCompositeSerializeAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['*/*'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $outerComposite = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $outerComposite = $this->deserialize($outerComposite, 'OpenAPI\Server\Model\OuterComposite', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\OuterComposite");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($outerComposite, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fakeOuterCompositeSerialize($outerComposite, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Output composite';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation fakeOuterNumberSerialize
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function fakeOuterNumberSerializeAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['*/*'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $body = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $body = $this->deserialize($body, 'float', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\Type("float");
+ $response = $this->validate($body, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fakeOuterNumberSerialize($body, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Output number';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation fakeOuterStringSerialize
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function fakeOuterStringSerializeAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['*/*'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $body = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $body = $this->deserialize($body, 'string', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($body, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->fakeOuterStringSerialize($body, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Output string';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testBodyWithFileSchema
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testBodyWithFileSchemaAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $fileSchemaTestClass = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $fileSchemaTestClass = $this->deserialize($fileSchemaTestClass, 'OpenAPI\Server\Model\FileSchemaTestClass', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\FileSchemaTestClass");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($fileSchemaTestClass, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testBodyWithFileSchema($fileSchemaTestClass, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Success';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testBodyWithQueryParams
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testBodyWithQueryParamsAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $query = $request->query->get('query');
+ $user = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $query = $this->deserialize($query, 'string', 'string');
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($query, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\User");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($user, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testBodyWithQueryParams($query, $user, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Success';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testClientModel
+ *
+ * To test \"client\" model
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testClientModelAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $client = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $client = $this->deserialize($client, 'OpenAPI\Server\Model\Client', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Client");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($client, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->testClientModel($client, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testEndpointParameters
+ *
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testEndpointParametersAction(Request $request)
+ {
+ // Handle authentication
+ // Authentication 'http_basic_test' required
+ // HTTP basic authentication required
+ $securityhttp_basic_test = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $integer = $request->request->get('integer');
+ $int32 = $request->request->get('int32');
+ $int64 = $request->request->get('int64');
+ $number = $request->request->get('number');
+ $float = $request->request->get('float');
+ $double = $request->request->get('double');
+ $string = $request->request->get('string');
+ $patternWithoutDelimiter = $request->request->get('patternWithoutDelimiter');
+ $byte = $request->request->get('byte');
+ $binary = $request->files->get('binary');
+ $date = $request->request->get('date');
+ $dateTime = $request->request->get('dateTime');
+ $password = $request->request->get('password');
+ $callback = $request->request->get('callback');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $number = $this->deserialize($number, 'float', 'string');
+ $double = $this->deserialize($double, 'double', 'string');
+ $patternWithoutDelimiter = $this->deserialize($patternWithoutDelimiter, 'string', 'string');
+ $byte = $this->deserialize($byte, 'string', 'string');
+ $integer = $this->deserialize($integer, 'int', 'string');
+ $int32 = $this->deserialize($int32, 'int', 'string');
+ $int64 = $this->deserialize($int64, 'int', 'string');
+ $float = $this->deserialize($float, 'float', 'string');
+ $string = $this->deserialize($string, 'string', 'string');
+ $date = $this->deserialize($date, '\DateTime', 'string');
+ $dateTime = $this->deserialize($dateTime, '\DateTime', 'string');
+ $password = $this->deserialize($password, 'string', 'string');
+ $callback = $this->deserialize($callback, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("float");
+ $asserts[] = new Assert\GreaterThanOrEqual(32.1);
+ $asserts[] = new Assert\LessThanOrEqual(543.2);
+ $response = $this->validate($number, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("double");
+ $asserts[] = new Assert\GreaterThanOrEqual(67.8);
+ $asserts[] = new Assert\LessThanOrEqual(123.4);
+ $response = $this->validate($double, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $asserts[] = new Assert\Regex("/^[A-Z].*/");
+ $response = $this->validate($patternWithoutDelimiter, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($byte, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("int");
+ $asserts[] = new Assert\GreaterThanOrEqual(10);
+ $asserts[] = new Assert\LessThanOrEqual(100);
+ $response = $this->validate($integer, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("int");
+ $asserts[] = new Assert\GreaterThanOrEqual(20);
+ $asserts[] = new Assert\LessThanOrEqual(200);
+ $response = $this->validate($int32, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($int64, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("float");
+ $asserts[] = new Assert\LessThanOrEqual(987.6);
+ $response = $this->validate($float, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $asserts[] = new Assert\Regex("//[a-z]/i/");
+ $response = $this->validate($string, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\File();
+ $response = $this->validate($binary, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Date();
+ $response = $this->validate($date, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\DateTime();
+ $response = $this->validate($dateTime, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $asserts[] = new Assert\Length([
+ 'max' => 64
+ ]);
+ $asserts[] = new Assert\Length([
+ 'min' => 10
+ ]);
+ $response = $this->validate($password, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($callback, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'http_basic_test'
+ $handler->sethttp_basic_test($securityhttp_basic_test);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testEndpointParameters($number, $double, $patternWithoutDelimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $dateTime, $password, $callback, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid username supplied';
+ break;
+ case 404:
+ $message = 'User not found';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testEnumParameters
+ *
+ * To test enum parameters
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testEnumParametersAction(Request $request)
+ {
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $enumQueryStringArray = $request->query->get('enumQueryStringArray');
+ $enumQueryString = $request->query->get('enumQueryString');
+ $enumQueryInteger = $request->query->get('enumQueryInteger');
+ $enumQueryDouble = $request->query->get('enumQueryDouble');
+ $enumHeaderStringArray = $request->headers->get('enum_header_string_array');
+ $enumHeaderString = $request->headers->get('enum_header_string');
+ $enumFormStringArray = $request->request->get('enumFormStringArray');
+ $enumFormString = $request->request->get('enumFormString');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $enumHeaderStringArray = $this->deserialize($enumHeaderStringArray, 'array', 'string');
+ $enumHeaderString = $this->deserialize($enumHeaderString, 'string', 'string');
+ $enumQueryStringArray = $this->deserialize($enumQueryStringArray, 'array', 'string');
+ $enumQueryString = $this->deserialize($enumQueryString, 'string', 'string');
+ $enumQueryInteger = $this->deserialize($enumQueryInteger, 'int', 'string');
+ $enumQueryDouble = $this->deserialize($enumQueryDouble, 'double', 'string');
+ $enumFormStringArray = $this->deserialize($enumFormStringArray, 'array', 'string');
+ $enumFormString = $this->deserialize($enumFormString, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\All([
+ new Assert\Choice([ ">", "$" ])
+ ]);
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($enumHeaderStringArray, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Choice([ "_abc", "-efg", "(xyz)" ]);
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($enumHeaderString, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\All([
+ new Assert\Choice([ ">", "$" ])
+ ]);
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($enumQueryStringArray, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Choice([ "_abc", "-efg", "(xyz)" ]);
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($enumQueryString, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Choice([ 1, -2 ]);
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($enumQueryInteger, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Choice([ 1.1, -1.2 ]);
+ $asserts[] = new Assert\Type("double");
+ $response = $this->validate($enumQueryDouble, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\All([
+ new Assert\Choice([ ])
+ ]);
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($enumFormStringArray, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Choice([ "_abc", "-efg", "(xyz)" ]);
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($enumFormString, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testEnumParameters($enumHeaderStringArray, $enumHeaderString, $enumQueryStringArray, $enumQueryString, $enumQueryInteger, $enumQueryDouble, $enumFormStringArray, $enumFormString, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid request';
+ break;
+ case 404:
+ $message = 'Not found';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testGroupParameters
+ *
+ * Fake endpoint to test group parameters (optional)
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testGroupParametersAction(Request $request)
+ {
+ // Handle authentication
+ // Authentication 'bearer_test' required
+ // HTTP basic authentication required
+ $securitybearer_test = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $requiredStringGroup = $request->query->get('requiredStringGroup');
+ $requiredInt64Group = $request->query->get('requiredInt64Group');
+ $stringGroup = $request->query->get('stringGroup');
+ $int64Group = $request->query->get('int64Group');
+ $requiredBooleanGroup = $request->headers->get('required_boolean_group');
+ $booleanGroup = $request->headers->get('boolean_group');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $requiredStringGroup = $this->deserialize($requiredStringGroup, 'int', 'string');
+ $requiredBooleanGroup = $this->deserialize($requiredBooleanGroup, 'bool', 'string');
+ $requiredInt64Group = $this->deserialize($requiredInt64Group, 'int', 'string');
+ $stringGroup = $this->deserialize($stringGroup, 'int', 'string');
+ $booleanGroup = $this->deserialize($booleanGroup, 'bool', 'string');
+ $int64Group = $this->deserialize($int64Group, 'int', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($requiredStringGroup, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("bool");
+ $response = $this->validate($requiredBooleanGroup, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($requiredInt64Group, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($stringGroup, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("bool");
+ $response = $this->validate($booleanGroup, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($int64Group, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'bearer_test'
+ $handler->setbearer_test($securitybearer_test);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testGroupParameters($requiredStringGroup, $requiredBooleanGroup, $requiredInt64Group, $stringGroup, $booleanGroup, $int64Group, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Someting wrong';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testInlineAdditionalProperties
+ *
+ * test inline additionalProperties
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testInlineAdditionalPropertiesAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $requestBody = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $requestBody = $this->deserialize($requestBody, 'array', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($requestBody, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testInlineAdditionalProperties($requestBody, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testJsonFormData
+ *
+ * test json serialization of form data
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testJsonFormDataAction(Request $request)
+ {
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $param = $request->request->get('param');
+ $param2 = $request->request->get('param2');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $param = $this->deserialize($param, 'string', 'string');
+ $param2 = $this->deserialize($param2, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($param, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($param2, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testJsonFormData($param, $param2, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation testQueryParameterCollectionFormat
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function testQueryParameterCollectionFormatAction(Request $request)
+ {
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $pipe = $request->query->get('pipe');
+ $ioutil = $request->query->get('ioutil');
+ $http = $request->query->get('http');
+ $url = $request->query->get('url');
+ $context = $request->query->get('context');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $pipe = $this->deserialize($pipe, 'array', 'string');
+ $ioutil = $this->deserialize($ioutil, 'array', 'string');
+ $http = $this->deserialize($http, 'array', 'string');
+ $url = $this->deserialize($url, 'array', 'string');
+ $context = $this->deserialize($context, 'array', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($pipe, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($ioutil, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($http, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($url, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($context, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'Success';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return FakeApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('fake');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/PetController.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/PetController.php
new file mode 100644
index 000000000000..259beb753a37
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/PetController.php
@@ -0,0 +1,861 @@
+headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $pet = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($pet, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->addPet($pet, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 405:
+ $message = 'Invalid input';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation deletePet
+ *
+ * Deletes a pet
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function deletePetAction(Request $request, $petId)
+ {
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $apiKey = $request->headers->get('api_key');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $petId = $this->deserialize($petId, 'int', 'string');
+ $apiKey = $this->deserialize($apiKey, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($petId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($apiKey, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->deletePet($petId, $apiKey, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid pet value';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation findPetsByStatus
+ *
+ * Finds Pets by status
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function findPetsByStatusAction(Request $request)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $status = $request->query->get('status');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $status = $this->deserialize($status, 'array', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Choice([ "available", "pending", "sold" ])
+ ]);
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($status, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->findPetsByStatus($status, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid status value';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation findPetsByTags
+ *
+ * Finds Pets by tags
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function findPetsByTagsAction(Request $request)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $tags = $request->query->get('tags');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $tags = $this->deserialize($tags, 'array', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("string"),
+ ]);
+ $response = $this->validate($tags, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->findPetsByTags($tags, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid tag value';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation getPetById
+ *
+ * Find pet by ID
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function getPetByIdAction(Request $request, $petId)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'api_key' required
+ // Set key with prefix in header
+ $securityapi_key = $request->headers->get('api_key');
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $petId = $this->deserialize($petId, 'int', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($petId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'api_key'
+ $handler->setapi_key($securityapi_key);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->getPetById($petId, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid ID supplied';
+ break;
+ case 404:
+ $message = 'Pet not found';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation updatePet
+ *
+ * Update an existing pet
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function updatePetAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json', 'application/xml'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $pet = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($pet, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->updatePet($pet, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid ID supplied';
+ break;
+ case 404:
+ $message = 'Pet not found';
+ break;
+ case 405:
+ $message = 'Validation exception';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation updatePetWithForm
+ *
+ * Updates a pet in the store with form data
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function updatePetWithFormAction(Request $request, $petId)
+ {
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $name = $request->request->get('name');
+ $status = $request->request->get('status');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $petId = $this->deserialize($petId, 'int', 'string');
+ $name = $this->deserialize($name, 'string', 'string');
+ $status = $this->deserialize($status, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($petId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($name, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($status, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->updatePetWithForm($petId, $name, $status, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 405:
+ $message = 'Invalid input';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation uploadFile
+ *
+ * uploads an image
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function uploadFileAction(Request $request, $petId)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $additionalMetadata = $request->request->get('additionalMetadata');
+ $file = $request->files->get('file');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $petId = $this->deserialize($petId, 'int', 'string');
+ $additionalMetadata = $this->deserialize($additionalMetadata, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($petId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($additionalMetadata, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\File();
+ $response = $this->validate($file, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->uploadFile($petId, $additionalMetadata, $file, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation uploadFileWithRequiredFile
+ *
+ * uploads an image (required)
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function uploadFileWithRequiredFileAction(Request $request, $petId)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'petstore_auth' required
+ // Oauth required
+ $securitypetstore_auth = $request->headers->get('authorization');
+
+ // Read out all input parameter values into variables
+ $additionalMetadata = $request->request->get('additionalMetadata');
+ $requiredFile = $request->files->get('requiredFile');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $petId = $this->deserialize($petId, 'int', 'string');
+ $additionalMetadata = $this->deserialize($additionalMetadata, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $response = $this->validate($petId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\File();
+ $response = $this->validate($requiredFile, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($additionalMetadata, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'petstore_auth'
+ $handler->setpetstore_auth($securitypetstore_auth);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->uploadFileWithRequiredFile($petId, $requiredFile, $additionalMetadata, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return PetApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('pet');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/StoreController.php
new file mode 100644
index 000000000000..122a50843e72
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/StoreController.php
@@ -0,0 +1,373 @@
+deserialize($orderId, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($orderId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->deleteOrder($orderId, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid ID supplied';
+ break;
+ case 404:
+ $message = 'Order not found';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation getInventory
+ *
+ * Returns pet inventories by status
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function getInventoryAction(Request $request)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+ // Authentication 'api_key' required
+ // Set key with prefix in header
+ $securityapi_key = $request->headers->get('api_key');
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Validate the input values
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+ // Set authentication method 'api_key'
+ $handler->setapi_key($securityapi_key);
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->getInventory($responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation getOrderById
+ *
+ * Find purchase order by ID
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function getOrderByIdAction(Request $request, $orderId)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $orderId = $this->deserialize($orderId, 'int', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("int");
+ $asserts[] = new Assert\GreaterThanOrEqual(1);
+ $asserts[] = new Assert\LessThanOrEqual(5);
+ $response = $this->validate($orderId, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->getOrderById($orderId, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid ID supplied';
+ break;
+ case 404:
+ $message = 'Order not found';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation placeOrder
+ *
+ * Place an order for a pet
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function placeOrderAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $order = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $order = $this->deserialize($order, 'OpenAPI\Server\Model\Order', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\Order");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($order, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->placeOrder($order, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid Order';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return StoreApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('store');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/UserController.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/UserController.php
new file mode 100644
index 000000000000..b5a58edaa076
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Controller/UserController.php
@@ -0,0 +1,679 @@
+getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\User");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($user, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->createUser($user, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = 'successful operation';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 0:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation createUsersWithArrayInput
+ *
+ * Creates list of users with given input array
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function createUsersWithArrayInputAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $user = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $user = $this->deserialize($user, 'array', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("OpenAPI\Server\Model\User"),
+ new Assert\Valid(),
+ ]);
+ $response = $this->validate($user, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->createUsersWithArrayInput($user, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = 'successful operation';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 0:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation createUsersWithListInput
+ *
+ * Creates list of users with given input array
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function createUsersWithListInputAction(Request $request)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $user = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $user = $this->deserialize($user, 'array', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\All([
+ new Assert\Type("OpenAPI\Server\Model\User"),
+ new Assert\Valid(),
+ ]);
+ $response = $this->validate($user, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->createUsersWithListInput($user, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = 'successful operation';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 0:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation deleteUser
+ *
+ * Delete user
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function deleteUserAction(Request $request, $username)
+ {
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $username = $this->deserialize($username, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($username, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->deleteUser($username, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid username supplied';
+ break;
+ case 404:
+ $message = 'User not found';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation getUserByName
+ *
+ * Get user by user name
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function getUserByNameAction(Request $request, $username)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $username = $this->deserialize($username, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($username, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->getUserByName($username, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid username supplied';
+ break;
+ case 404:
+ $message = 'User not found';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation loginUser
+ *
+ * Logs user into the system
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function loginUserAction(Request $request)
+ {
+ // Figure out what data format to return to the client
+ $produces = ['application/xml', 'application/json'];
+ // Figure out what the client accepts
+ $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';
+ $responseFormat = $this->getOutputFormat($clientAccepts, $produces);
+ if ($responseFormat === null) {
+ return new Response('', 406);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $username = $request->query->get('username');
+ $password = $request->query->get('password');
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $username = $this->deserialize($username, 'string', 'string');
+ $password = $this->deserialize($password, 'string', 'string');
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($username, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($password, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 200;
+ $responseHeaders = [];
+ $result = $handler->loginUser($username, $password, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 200:
+ $message = 'successful operation';
+ break;
+ case 400:
+ $message = 'Invalid username/password supplied';
+ break;
+ }
+
+ return new Response(
+ $result !== null ?$this->serialize($result, $responseFormat):'',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'Content-Type' => $responseFormat,
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation logoutUser
+ *
+ * Logs out current logged in user session
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function logoutUserAction(Request $request)
+ {
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+
+ // Use the default value if no value was provided
+
+ // Validate the input values
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->logoutUser($responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = 'successful operation';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 0:
+ $message = 'successful operation';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Operation updateUser
+ *
+ * Updated user
+ *
+ * @param Request $request The Symfony request to handle.
+ * @return Response The Symfony response.
+ */
+ public function updateUserAction(Request $request, $username)
+ {
+ // Make sure that the client is providing something that we can consume
+ $consumes = ['application/json'];
+ if (!static::isContentTypeAllowed($request, $consumes)) {
+ // We can't consume the content that the client is sending us
+ return new Response('', 415);
+ }
+
+ // Handle authentication
+
+ // Read out all input parameter values into variables
+ $user = $request->getContent();
+
+ // Use the default value if no value was provided
+
+ // Deserialize the input values that needs it
+ try {
+ $username = $this->deserialize($username, 'string', 'string');
+ $inputFormat = $request->getMimeType($request->getContentType());
+ $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat);
+ } catch (SerializerRuntimeException $exception) {
+ return $this->createBadRequestResponse($exception->getMessage());
+ }
+
+ // Validate the input values
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("string");
+ $response = $this->validate($username, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+ $asserts = [];
+ $asserts[] = new Assert\NotNull();
+ $asserts[] = new Assert\Type("OpenAPI\Server\Model\User");
+ $asserts[] = new Assert\Valid();
+ $response = $this->validate($user, $asserts);
+ if ($response instanceof Response) {
+ return $response;
+ }
+
+
+ try {
+ $handler = $this->getApiHandler();
+
+
+ // Make the call to the business logic
+ $responseCode = 204;
+ $responseHeaders = [];
+ $result = $handler->updateUser($username, $user, $responseCode, $responseHeaders);
+
+ // Find default response message
+ $message = '';
+
+ // Find a more specific message, if available
+ switch ($responseCode) {
+ case 400:
+ $message = 'Invalid user supplied';
+ break;
+ case 404:
+ $message = 'User not found';
+ break;
+ }
+
+ return new Response(
+ '',
+ $responseCode,
+ array_merge(
+ $responseHeaders,
+ [
+ 'X-OpenAPI-Message' => $message
+ ]
+ )
+ );
+ } catch (Exception $fallthrough) {
+ return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
+ }
+ }
+
+ /**
+ * Returns the handler for this API controller.
+ * @return UserApiInterface
+ */
+ public function getApiHandler()
+ {
+ return $this->apiServer->getApiHandler('user');
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/AdditionalPropertiesClass.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/AdditionalPropertiesClass.php
new file mode 100644
index 000000000000..50b64c3dc8a1
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/AdditionalPropertiesClass.php
@@ -0,0 +1,123 @@
+")
+ */
+ protected $mapProperty;
+
+ /**
+ * @var string[]|null
+ * @SerializedName("map_of_map_property")
+ * @Assert\All({
+ * @Assert\Type("string")
+ * })
+ * @Type("array")
+ */
+ protected $mapOfMapProperty;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->mapProperty = isset($data['mapProperty']) ? $data['mapProperty'] : null;
+ $this->mapOfMapProperty = isset($data['mapOfMapProperty']) ? $data['mapOfMapProperty'] : null;
+ }
+
+ /**
+ * Gets mapProperty.
+ *
+ * @return string[]|null
+ */
+ public function getMapProperty(): ?array
+ {
+ return $this->mapProperty;
+ }
+
+ /**
+ * Sets mapProperty.
+ *
+ * @param string[]|null $mapProperty
+ *
+ * @return $this
+ */
+ public function setMapProperty(array $mapProperty = null)
+ {
+ $this->mapProperty = $mapProperty;
+
+ return $this;
+ }
+
+ /**
+ * Gets mapOfMapProperty.
+ *
+ * @return string[]|null
+ */
+ public function getMapOfMapProperty(): ?array
+ {
+ return $this->mapOfMapProperty;
+ }
+
+ /**
+ * Sets mapOfMapProperty.
+ *
+ * @param string[]|null $mapOfMapProperty
+ *
+ * @return $this
+ */
+ public function setMapOfMapProperty(array $mapOfMapProperty = null)
+ {
+ $this->mapOfMapProperty = $mapOfMapProperty;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Animal.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Animal.php
new file mode 100644
index 000000000000..1e73ddb58586
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Animal.php
@@ -0,0 +1,120 @@
+className = isset($data['className']) ? $data['className'] : null;
+ $this->color = isset($data['color']) ? $data['color'] : 'red';
+ }
+
+ /**
+ * Gets className.
+ *
+ * @return string
+ */
+ public function getClassName()
+ {
+ return $this->className;
+ }
+
+ /**
+ * Sets className.
+ *
+ * @param string $className
+ *
+ * @return $this
+ */
+ public function setClassName($className)
+ {
+ $this->className = $className;
+
+ return $this;
+ }
+
+ /**
+ * Gets color.
+ *
+ * @return string|null
+ */
+ public function getColor()
+ {
+ return $this->color;
+ }
+
+ /**
+ * Sets color.
+ *
+ * @param string|null $color
+ *
+ * @return $this
+ */
+ public function setColor($color = null)
+ {
+ $this->color = $color;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ApiResponse.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ApiResponse.php
new file mode 100644
index 000000000000..4334c91c42c0
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ApiResponse.php
@@ -0,0 +1,152 @@
+code = isset($data['code']) ? $data['code'] : null;
+ $this->type = isset($data['type']) ? $data['type'] : null;
+ $this->message = isset($data['message']) ? $data['message'] : null;
+ }
+
+ /**
+ * Gets code.
+ *
+ * @return int|null
+ */
+ public function getCode()
+ {
+ return $this->code;
+ }
+
+ /**
+ * Sets code.
+ *
+ * @param int|null $code
+ *
+ * @return $this
+ */
+ public function setCode($code = null)
+ {
+ $this->code = $code;
+
+ return $this;
+ }
+
+ /**
+ * Gets type.
+ *
+ * @return string|null
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * Sets type.
+ *
+ * @param string|null $type
+ *
+ * @return $this
+ */
+ public function setType($type = null)
+ {
+ $this->type = $type;
+
+ return $this;
+ }
+
+ /**
+ * Gets message.
+ *
+ * @return string|null
+ */
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /**
+ * Sets message.
+ *
+ * @param string|null $message
+ *
+ * @return $this
+ */
+ public function setMessage($message = null)
+ {
+ $this->message = $message;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfArrayOfNumberOnly.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfArrayOfNumberOnly.php
new file mode 100644
index 000000000000..0fcd7b3b49d9
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfArrayOfNumberOnly.php
@@ -0,0 +1,88 @@
+")
+ */
+ protected $arrayArrayNumber;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->arrayArrayNumber = isset($data['arrayArrayNumber']) ? $data['arrayArrayNumber'] : null;
+ }
+
+ /**
+ * Gets arrayArrayNumber.
+ *
+ * @return float[]|null
+ */
+ public function getArrayArrayNumber(): ?array
+ {
+ return $this->arrayArrayNumber;
+ }
+
+ /**
+ * Sets arrayArrayNumber.
+ *
+ * @param float[]|null $arrayArrayNumber
+ *
+ * @return $this
+ */
+ public function setArrayArrayNumber(array $arrayArrayNumber = null)
+ {
+ $this->arrayArrayNumber = $arrayArrayNumber;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfNumberOnly.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfNumberOnly.php
new file mode 100644
index 000000000000..36f8294f063f
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayOfNumberOnly.php
@@ -0,0 +1,88 @@
+")
+ */
+ protected $arrayNumber;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->arrayNumber = isset($data['arrayNumber']) ? $data['arrayNumber'] : null;
+ }
+
+ /**
+ * Gets arrayNumber.
+ *
+ * @return float[]|null
+ */
+ public function getArrayNumber(): ?array
+ {
+ return $this->arrayNumber;
+ }
+
+ /**
+ * Sets arrayNumber.
+ *
+ * @param float[]|null $arrayNumber
+ *
+ * @return $this
+ */
+ public function setArrayNumber(array $arrayNumber = null)
+ {
+ $this->arrayNumber = $arrayNumber;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayTest.php
new file mode 100644
index 000000000000..3262e713f4f4
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ArrayTest.php
@@ -0,0 +1,158 @@
+")
+ */
+ protected $arrayOfString;
+
+ /**
+ * @var int[]|null
+ * @SerializedName("array_array_of_integer")
+ * @Assert\All({
+ * @Assert\Type("int")
+ * })
+ * @Type("array")
+ */
+ protected $arrayArrayOfInteger;
+
+ /**
+ * @var OpenAPI\Server\Model\ReadOnlyFirst[]|null
+ * @SerializedName("array_array_of_model")
+ * @Assert\All({
+ * @Assert\Type("OpenAPI\Server\Model\ReadOnlyFirst")
+ * })
+ * @Type("array")
+ */
+ protected $arrayArrayOfModel;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->arrayOfString = isset($data['arrayOfString']) ? $data['arrayOfString'] : null;
+ $this->arrayArrayOfInteger = isset($data['arrayArrayOfInteger']) ? $data['arrayArrayOfInteger'] : null;
+ $this->arrayArrayOfModel = isset($data['arrayArrayOfModel']) ? $data['arrayArrayOfModel'] : null;
+ }
+
+ /**
+ * Gets arrayOfString.
+ *
+ * @return string[]|null
+ */
+ public function getArrayOfString(): ?array
+ {
+ return $this->arrayOfString;
+ }
+
+ /**
+ * Sets arrayOfString.
+ *
+ * @param string[]|null $arrayOfString
+ *
+ * @return $this
+ */
+ public function setArrayOfString(array $arrayOfString = null)
+ {
+ $this->arrayOfString = $arrayOfString;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayArrayOfInteger.
+ *
+ * @return int[]|null
+ */
+ public function getArrayArrayOfInteger(): ?array
+ {
+ return $this->arrayArrayOfInteger;
+ }
+
+ /**
+ * Sets arrayArrayOfInteger.
+ *
+ * @param int[]|null $arrayArrayOfInteger
+ *
+ * @return $this
+ */
+ public function setArrayArrayOfInteger(array $arrayArrayOfInteger = null)
+ {
+ $this->arrayArrayOfInteger = $arrayArrayOfInteger;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayArrayOfModel.
+ *
+ * @return OpenAPI\Server\Model\ReadOnlyFirst[]|null
+ */
+ public function getArrayArrayOfModel(): ?array
+ {
+ return $this->arrayArrayOfModel;
+ }
+
+ /**
+ * Sets arrayArrayOfModel.
+ *
+ * @param OpenAPI\Server\Model\ReadOnlyFirst[]|null $arrayArrayOfModel
+ *
+ * @return $this
+ */
+ public function setArrayArrayOfModel(array $arrayArrayOfModel = null)
+ {
+ $this->arrayArrayOfModel = $arrayArrayOfModel;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Capitalization.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Capitalization.php
new file mode 100644
index 000000000000..48fec1c3ab70
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Capitalization.php
@@ -0,0 +1,253 @@
+smallCamel = isset($data['smallCamel']) ? $data['smallCamel'] : null;
+ $this->capitalCamel = isset($data['capitalCamel']) ? $data['capitalCamel'] : null;
+ $this->smallSnake = isset($data['smallSnake']) ? $data['smallSnake'] : null;
+ $this->capitalSnake = isset($data['capitalSnake']) ? $data['capitalSnake'] : null;
+ $this->sCAETHFlowPoints = isset($data['sCAETHFlowPoints']) ? $data['sCAETHFlowPoints'] : null;
+ $this->aTTNAME = isset($data['aTTNAME']) ? $data['aTTNAME'] : null;
+ }
+
+ /**
+ * Gets smallCamel.
+ *
+ * @return string|null
+ */
+ public function getSmallCamel()
+ {
+ return $this->smallCamel;
+ }
+
+ /**
+ * Sets smallCamel.
+ *
+ * @param string|null $smallCamel
+ *
+ * @return $this
+ */
+ public function setSmallCamel($smallCamel = null)
+ {
+ $this->smallCamel = $smallCamel;
+
+ return $this;
+ }
+
+ /**
+ * Gets capitalCamel.
+ *
+ * @return string|null
+ */
+ public function getCapitalCamel()
+ {
+ return $this->capitalCamel;
+ }
+
+ /**
+ * Sets capitalCamel.
+ *
+ * @param string|null $capitalCamel
+ *
+ * @return $this
+ */
+ public function setCapitalCamel($capitalCamel = null)
+ {
+ $this->capitalCamel = $capitalCamel;
+
+ return $this;
+ }
+
+ /**
+ * Gets smallSnake.
+ *
+ * @return string|null
+ */
+ public function getSmallSnake()
+ {
+ return $this->smallSnake;
+ }
+
+ /**
+ * Sets smallSnake.
+ *
+ * @param string|null $smallSnake
+ *
+ * @return $this
+ */
+ public function setSmallSnake($smallSnake = null)
+ {
+ $this->smallSnake = $smallSnake;
+
+ return $this;
+ }
+
+ /**
+ * Gets capitalSnake.
+ *
+ * @return string|null
+ */
+ public function getCapitalSnake()
+ {
+ return $this->capitalSnake;
+ }
+
+ /**
+ * Sets capitalSnake.
+ *
+ * @param string|null $capitalSnake
+ *
+ * @return $this
+ */
+ public function setCapitalSnake($capitalSnake = null)
+ {
+ $this->capitalSnake = $capitalSnake;
+
+ return $this;
+ }
+
+ /**
+ * Gets sCAETHFlowPoints.
+ *
+ * @return string|null
+ */
+ public function getSCAETHFlowPoints()
+ {
+ return $this->sCAETHFlowPoints;
+ }
+
+ /**
+ * Sets sCAETHFlowPoints.
+ *
+ * @param string|null $sCAETHFlowPoints
+ *
+ * @return $this
+ */
+ public function setSCAETHFlowPoints($sCAETHFlowPoints = null)
+ {
+ $this->sCAETHFlowPoints = $sCAETHFlowPoints;
+
+ return $this;
+ }
+
+ /**
+ * Gets aTTNAME.
+ *
+ * @return string|null
+ */
+ public function getATTNAME()
+ {
+ return $this->aTTNAME;
+ }
+
+ /**
+ * Sets aTTNAME.
+ *
+ * @param string|null $aTTNAME Name of the pet
+ *
+ * @return $this
+ */
+ public function setATTNAME($aTTNAME = null)
+ {
+ $this->aTTNAME = $aTTNAME;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Cat.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Cat.php
new file mode 100644
index 000000000000..929282157e1c
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Cat.php
@@ -0,0 +1,88 @@
+declawed = isset($data['declawed']) ? $data['declawed'] : null;
+ }
+
+ /**
+ * Gets declawed.
+ *
+ * @return bool|null
+ */
+ public function isDeclawed()
+ {
+ return $this->declawed;
+ }
+
+ /**
+ * Sets declawed.
+ *
+ * @param bool|null $declawed
+ *
+ * @return $this
+ */
+ public function setDeclawed($declawed = null)
+ {
+ $this->declawed = $declawed;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/CatAllOf.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/CatAllOf.php
new file mode 100644
index 000000000000..9b805d944877
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/CatAllOf.php
@@ -0,0 +1,86 @@
+declawed = isset($data['declawed']) ? $data['declawed'] : null;
+ }
+
+ /**
+ * Gets declawed.
+ *
+ * @return bool|null
+ */
+ public function isDeclawed()
+ {
+ return $this->declawed;
+ }
+
+ /**
+ * Sets declawed.
+ *
+ * @param bool|null $declawed
+ *
+ * @return $this
+ */
+ public function setDeclawed($declawed = null)
+ {
+ $this->declawed = $declawed;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Category.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Category.php
new file mode 100644
index 000000000000..65b817066b62
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Category.php
@@ -0,0 +1,120 @@
+id = isset($data['id']) ? $data['id'] : null;
+ $this->name = isset($data['name']) ? $data['name'] : 'default-name';
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return int|null
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets id.
+ *
+ * @param int|null $id
+ *
+ * @return $this
+ */
+ public function setId($id = null)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param string $name
+ *
+ * @return $this
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ClassModel.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ClassModel.php
new file mode 100644
index 000000000000..be8bb789a7ae
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ClassModel.php
@@ -0,0 +1,88 @@
+class = isset($data['class']) ? $data['class'] : null;
+ }
+
+ /**
+ * Gets class.
+ *
+ * @return string|null
+ */
+ public function getClass()
+ {
+ return $this->class;
+ }
+
+ /**
+ * Sets class.
+ *
+ * @param string|null $class
+ *
+ * @return $this
+ */
+ public function setClass($class = null)
+ {
+ $this->class = $class;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Client.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Client.php
new file mode 100644
index 000000000000..39fe10e0a7a7
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Client.php
@@ -0,0 +1,86 @@
+client = isset($data['client']) ? $data['client'] : null;
+ }
+
+ /**
+ * Gets client.
+ *
+ * @return string|null
+ */
+ public function getClient()
+ {
+ return $this->client;
+ }
+
+ /**
+ * Sets client.
+ *
+ * @param string|null $client
+ *
+ * @return $this
+ */
+ public function setClient($client = null)
+ {
+ $this->client = $client;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Dog.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Dog.php
new file mode 100644
index 000000000000..e591d45d06bc
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Dog.php
@@ -0,0 +1,88 @@
+breed = isset($data['breed']) ? $data['breed'] : null;
+ }
+
+ /**
+ * Gets breed.
+ *
+ * @return string|null
+ */
+ public function getBreed()
+ {
+ return $this->breed;
+ }
+
+ /**
+ * Sets breed.
+ *
+ * @param string|null $breed
+ *
+ * @return $this
+ */
+ public function setBreed($breed = null)
+ {
+ $this->breed = $breed;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/DogAllOf.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/DogAllOf.php
new file mode 100644
index 000000000000..b2d2db9ee6ac
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/DogAllOf.php
@@ -0,0 +1,86 @@
+breed = isset($data['breed']) ? $data['breed'] : null;
+ }
+
+ /**
+ * Gets breed.
+ *
+ * @return string|null
+ */
+ public function getBreed()
+ {
+ return $this->breed;
+ }
+
+ /**
+ * Sets breed.
+ *
+ * @param string|null $breed
+ *
+ * @return $this
+ */
+ public function setBreed($breed = null)
+ {
+ $this->breed = $breed;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumArrays.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumArrays.php
new file mode 100644
index 000000000000..1ff20ea81527
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumArrays.php
@@ -0,0 +1,125 @@
+=", "$" })
+ * @Assert\Type("string")
+ * @Type("string")
+ */
+ protected $justSymbol;
+
+ /**
+ * @var string[]|null
+ * @SerializedName("array_enum")
+ * @Assert\All({
+ * @Assert\Choice({ "fish", "crab" })
+ * })
+ * @Assert\All({
+ * @Assert\Type("string")
+ * })
+ * @Type("array")
+ */
+ protected $arrayEnum;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->justSymbol = isset($data['justSymbol']) ? $data['justSymbol'] : null;
+ $this->arrayEnum = isset($data['arrayEnum']) ? $data['arrayEnum'] : null;
+ }
+
+ /**
+ * Gets justSymbol.
+ *
+ * @return string|null
+ */
+ public function getJustSymbol()
+ {
+ return $this->justSymbol;
+ }
+
+ /**
+ * Sets justSymbol.
+ *
+ * @param string|null $justSymbol
+ *
+ * @return $this
+ */
+ public function setJustSymbol($justSymbol = null)
+ {
+ $this->justSymbol = $justSymbol;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayEnum.
+ *
+ * @return string[]|null
+ */
+ public function getArrayEnum(): ?array
+ {
+ return $this->arrayEnum;
+ }
+
+ /**
+ * Sets arrayEnum.
+ *
+ * @param string[]|null $arrayEnum
+ *
+ * @return $this
+ */
+ public function setArrayEnum(array $arrayEnum = null)
+ {
+ $this->arrayEnum = $arrayEnum;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumClass.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumClass.php
new file mode 100644
index 000000000000..2dee02cb3de5
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/EnumClass.php
@@ -0,0 +1,53 @@
+enumString = isset($data['enumString']) ? $data['enumString'] : null;
+ $this->enumStringRequired = isset($data['enumStringRequired']) ? $data['enumStringRequired'] : null;
+ $this->enumInteger = isset($data['enumInteger']) ? $data['enumInteger'] : null;
+ $this->enumNumber = isset($data['enumNumber']) ? $data['enumNumber'] : null;
+ $this->outerEnum = isset($data['outerEnum']) ? $data['outerEnum'] : null;
+ $this->outerEnumInteger = isset($data['outerEnumInteger']) ? $data['outerEnumInteger'] : null;
+ $this->outerEnumDefaultValue = isset($data['outerEnumDefaultValue']) ? $data['outerEnumDefaultValue'] : null;
+ $this->outerEnumIntegerDefaultValue = isset($data['outerEnumIntegerDefaultValue']) ? $data['outerEnumIntegerDefaultValue'] : null;
+ }
+
+ /**
+ * Gets enumString.
+ *
+ * @return string|null
+ */
+ public function getEnumString()
+ {
+ return $this->enumString;
+ }
+
+ /**
+ * Sets enumString.
+ *
+ * @param string|null $enumString
+ *
+ * @return $this
+ */
+ public function setEnumString($enumString = null)
+ {
+ $this->enumString = $enumString;
+
+ return $this;
+ }
+
+ /**
+ * Gets enumStringRequired.
+ *
+ * @return string
+ */
+ public function getEnumStringRequired()
+ {
+ return $this->enumStringRequired;
+ }
+
+ /**
+ * Sets enumStringRequired.
+ *
+ * @param string $enumStringRequired
+ *
+ * @return $this
+ */
+ public function setEnumStringRequired($enumStringRequired)
+ {
+ $this->enumStringRequired = $enumStringRequired;
+
+ return $this;
+ }
+
+ /**
+ * Gets enumInteger.
+ *
+ * @return int|null
+ */
+ public function getEnumInteger()
+ {
+ return $this->enumInteger;
+ }
+
+ /**
+ * Sets enumInteger.
+ *
+ * @param int|null $enumInteger
+ *
+ * @return $this
+ */
+ public function setEnumInteger($enumInteger = null)
+ {
+ $this->enumInteger = $enumInteger;
+
+ return $this;
+ }
+
+ /**
+ * Gets enumNumber.
+ *
+ * @return double|null
+ */
+ public function getEnumNumber()
+ {
+ return $this->enumNumber;
+ }
+
+ /**
+ * Sets enumNumber.
+ *
+ * @param double|null $enumNumber
+ *
+ * @return $this
+ */
+ public function setEnumNumber($enumNumber = null)
+ {
+ $this->enumNumber = $enumNumber;
+
+ return $this;
+ }
+
+ /**
+ * Gets outerEnum.
+ *
+ * @return OpenAPI\Server\Model\OuterEnum|null
+ */
+ public function getOuterEnum(): ?OuterEnum
+ {
+ return $this->outerEnum;
+ }
+
+ /**
+ * Sets outerEnum.
+ *
+ * @param OpenAPI\Server\Model\OuterEnum|null $outerEnum
+ *
+ * @return $this
+ */
+ public function setOuterEnum(OuterEnum $outerEnum = null)
+ {
+ $this->outerEnum = $outerEnum;
+
+ return $this;
+ }
+
+ /**
+ * Gets outerEnumInteger.
+ *
+ * @return OpenAPI\Server\Model\OuterEnumInteger|null
+ */
+ public function getOuterEnumInteger(): ?OuterEnumInteger
+ {
+ return $this->outerEnumInteger;
+ }
+
+ /**
+ * Sets outerEnumInteger.
+ *
+ * @param OpenAPI\Server\Model\OuterEnumInteger|null $outerEnumInteger
+ *
+ * @return $this
+ */
+ public function setOuterEnumInteger(OuterEnumInteger $outerEnumInteger = null)
+ {
+ $this->outerEnumInteger = $outerEnumInteger;
+
+ return $this;
+ }
+
+ /**
+ * Gets outerEnumDefaultValue.
+ *
+ * @return OpenAPI\Server\Model\OuterEnumDefaultValue|null
+ */
+ public function getOuterEnumDefaultValue(): ?OuterEnumDefaultValue
+ {
+ return $this->outerEnumDefaultValue;
+ }
+
+ /**
+ * Sets outerEnumDefaultValue.
+ *
+ * @param OpenAPI\Server\Model\OuterEnumDefaultValue|null $outerEnumDefaultValue
+ *
+ * @return $this
+ */
+ public function setOuterEnumDefaultValue(OuterEnumDefaultValue $outerEnumDefaultValue = null)
+ {
+ $this->outerEnumDefaultValue = $outerEnumDefaultValue;
+
+ return $this;
+ }
+
+ /**
+ * Gets outerEnumIntegerDefaultValue.
+ *
+ * @return OpenAPI\Server\Model\OuterEnumIntegerDefaultValue|null
+ */
+ public function getOuterEnumIntegerDefaultValue(): ?OuterEnumIntegerDefaultValue
+ {
+ return $this->outerEnumIntegerDefaultValue;
+ }
+
+ /**
+ * Sets outerEnumIntegerDefaultValue.
+ *
+ * @param OpenAPI\Server\Model\OuterEnumIntegerDefaultValue|null $outerEnumIntegerDefaultValue
+ *
+ * @return $this
+ */
+ public function setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue $outerEnumIntegerDefaultValue = null)
+ {
+ $this->outerEnumIntegerDefaultValue = $outerEnumIntegerDefaultValue;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/File.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/File.php
new file mode 100644
index 000000000000..8957da61b62f
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/File.php
@@ -0,0 +1,90 @@
+sourceURI = isset($data['sourceURI']) ? $data['sourceURI'] : null;
+ }
+
+ /**
+ * Gets sourceURI.
+ *
+ * @return string|null
+ */
+ public function getSourceURI()
+ {
+ return $this->sourceURI;
+ }
+
+ /**
+ * Sets sourceURI.
+ *
+ * @param string|null $sourceURI Test capitalization
+ *
+ * @return $this
+ */
+ public function setSourceURI($sourceURI = null)
+ {
+ $this->sourceURI = $sourceURI;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FileSchemaTestClass.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FileSchemaTestClass.php
new file mode 100644
index 000000000000..5691e305a395
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FileSchemaTestClass.php
@@ -0,0 +1,121 @@
+")
+ */
+ protected $files;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->file = isset($data['file']) ? $data['file'] : null;
+ $this->files = isset($data['files']) ? $data['files'] : null;
+ }
+
+ /**
+ * Gets file.
+ *
+ * @return OpenAPI\Server\Model\File|null
+ */
+ public function getFile(): ?File
+ {
+ return $this->file;
+ }
+
+ /**
+ * Sets file.
+ *
+ * @param OpenAPI\Server\Model\File|null $file
+ *
+ * @return $this
+ */
+ public function setFile(File $file = null)
+ {
+ $this->file = $file;
+
+ return $this;
+ }
+
+ /**
+ * Gets files.
+ *
+ * @return OpenAPI\Server\Model\File[]|null
+ */
+ public function getFiles(): ?array
+ {
+ return $this->files;
+ }
+
+ /**
+ * Sets files.
+ *
+ * @param OpenAPI\Server\Model\File[]|null $files
+ *
+ * @return $this
+ */
+ public function setFiles(array $files = null)
+ {
+ $this->files = $files;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Foo.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Foo.php
new file mode 100644
index 000000000000..94e5d51395bf
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Foo.php
@@ -0,0 +1,86 @@
+bar = isset($data['bar']) ? $data['bar'] : 'bar';
+ }
+
+ /**
+ * Gets bar.
+ *
+ * @return string|null
+ */
+ public function getBar()
+ {
+ return $this->bar;
+ }
+
+ /**
+ * Sets bar.
+ *
+ * @param string|null $bar
+ *
+ * @return $this
+ */
+ public function setBar($bar = null)
+ {
+ $this->bar = $bar;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FormatTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FormatTest.php
new file mode 100644
index 000000000000..8a24a6f8afd5
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/FormatTest.php
@@ -0,0 +1,575 @@
+integer = isset($data['integer']) ? $data['integer'] : null;
+ $this->int32 = isset($data['int32']) ? $data['int32'] : null;
+ $this->int64 = isset($data['int64']) ? $data['int64'] : null;
+ $this->number = isset($data['number']) ? $data['number'] : null;
+ $this->float = isset($data['float']) ? $data['float'] : null;
+ $this->double = isset($data['double']) ? $data['double'] : null;
+ $this->string = isset($data['string']) ? $data['string'] : null;
+ $this->byte = isset($data['byte']) ? $data['byte'] : null;
+ $this->binary = isset($data['binary']) ? $data['binary'] : null;
+ $this->date = isset($data['date']) ? $data['date'] : null;
+ $this->dateTime = isset($data['dateTime']) ? $data['dateTime'] : null;
+ $this->uuid = isset($data['uuid']) ? $data['uuid'] : null;
+ $this->password = isset($data['password']) ? $data['password'] : null;
+ $this->patternWithDigits = isset($data['patternWithDigits']) ? $data['patternWithDigits'] : null;
+ $this->patternWithDigitsAndDelimiter = isset($data['patternWithDigitsAndDelimiter']) ? $data['patternWithDigitsAndDelimiter'] : null;
+ }
+
+ /**
+ * Gets integer.
+ *
+ * @return int|null
+ */
+ public function getInteger()
+ {
+ return $this->integer;
+ }
+
+ /**
+ * Sets integer.
+ *
+ * @param int|null $integer
+ *
+ * @return $this
+ */
+ public function setInteger($integer = null)
+ {
+ $this->integer = $integer;
+
+ return $this;
+ }
+
+ /**
+ * Gets int32.
+ *
+ * @return int|null
+ */
+ public function getInt32()
+ {
+ return $this->int32;
+ }
+
+ /**
+ * Sets int32.
+ *
+ * @param int|null $int32
+ *
+ * @return $this
+ */
+ public function setInt32($int32 = null)
+ {
+ $this->int32 = $int32;
+
+ return $this;
+ }
+
+ /**
+ * Gets int64.
+ *
+ * @return int|null
+ */
+ public function getInt64()
+ {
+ return $this->int64;
+ }
+
+ /**
+ * Sets int64.
+ *
+ * @param int|null $int64
+ *
+ * @return $this
+ */
+ public function setInt64($int64 = null)
+ {
+ $this->int64 = $int64;
+
+ return $this;
+ }
+
+ /**
+ * Gets number.
+ *
+ * @return float
+ */
+ public function getNumber()
+ {
+ return $this->number;
+ }
+
+ /**
+ * Sets number.
+ *
+ * @param float $number
+ *
+ * @return $this
+ */
+ public function setNumber($number)
+ {
+ $this->number = $number;
+
+ return $this;
+ }
+
+ /**
+ * Gets float.
+ *
+ * @return float|null
+ */
+ public function getFloat()
+ {
+ return $this->float;
+ }
+
+ /**
+ * Sets float.
+ *
+ * @param float|null $float
+ *
+ * @return $this
+ */
+ public function setFloat($float = null)
+ {
+ $this->float = $float;
+
+ return $this;
+ }
+
+ /**
+ * Gets double.
+ *
+ * @return double|null
+ */
+ public function getDouble()
+ {
+ return $this->double;
+ }
+
+ /**
+ * Sets double.
+ *
+ * @param double|null $double
+ *
+ * @return $this
+ */
+ public function setDouble($double = null)
+ {
+ $this->double = $double;
+
+ return $this;
+ }
+
+ /**
+ * Gets string.
+ *
+ * @return string|null
+ */
+ public function getString()
+ {
+ return $this->string;
+ }
+
+ /**
+ * Sets string.
+ *
+ * @param string|null $string
+ *
+ * @return $this
+ */
+ public function setString($string = null)
+ {
+ $this->string = $string;
+
+ return $this;
+ }
+
+ /**
+ * Gets byte.
+ *
+ * @return string
+ */
+ public function getByte()
+ {
+ return $this->byte;
+ }
+
+ /**
+ * Sets byte.
+ *
+ * @param string $byte
+ *
+ * @return $this
+ */
+ public function setByte($byte)
+ {
+ $this->byte = $byte;
+
+ return $this;
+ }
+
+ /**
+ * Gets binary.
+ *
+ * @return UploadedFile|null
+ */
+ public function getBinary(): ?UploadedFile
+ {
+ return $this->binary;
+ }
+
+ /**
+ * Sets binary.
+ *
+ * @param UploadedFile|null $binary
+ *
+ * @return $this
+ */
+ public function setBinary(UploadedFile $binary = null)
+ {
+ $this->binary = $binary;
+
+ return $this;
+ }
+
+ /**
+ * Gets date.
+ *
+ * @return \DateTime
+ */
+ public function getDate(): \DateTime
+ {
+ return $this->date;
+ }
+
+ /**
+ * Sets date.
+ *
+ * @param \DateTime $date
+ *
+ * @return $this
+ */
+ public function setDate(\DateTime $date)
+ {
+ $this->date = $date;
+
+ return $this;
+ }
+
+ /**
+ * Gets dateTime.
+ *
+ * @return \DateTime|null
+ */
+ public function getDateTime(): ?\DateTime
+ {
+ return $this->dateTime;
+ }
+
+ /**
+ * Sets dateTime.
+ *
+ * @param \DateTime|null $dateTime
+ *
+ * @return $this
+ */
+ public function setDateTime(\DateTime $dateTime = null)
+ {
+ $this->dateTime = $dateTime;
+
+ return $this;
+ }
+
+ /**
+ * Gets uuid.
+ *
+ * @return string|null
+ */
+ public function getUuid()
+ {
+ return $this->uuid;
+ }
+
+ /**
+ * Sets uuid.
+ *
+ * @param string|null $uuid
+ *
+ * @return $this
+ */
+ public function setUuid($uuid = null)
+ {
+ $this->uuid = $uuid;
+
+ return $this;
+ }
+
+ /**
+ * Gets password.
+ *
+ * @return string
+ */
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ /**
+ * Sets password.
+ *
+ * @param string $password
+ *
+ * @return $this
+ */
+ public function setPassword($password)
+ {
+ $this->password = $password;
+
+ return $this;
+ }
+
+ /**
+ * Gets patternWithDigits.
+ *
+ * @return string|null
+ */
+ public function getPatternWithDigits()
+ {
+ return $this->patternWithDigits;
+ }
+
+ /**
+ * Sets patternWithDigits.
+ *
+ * @param string|null $patternWithDigits A string that is a 10 digit number. Can have leading zeros.
+ *
+ * @return $this
+ */
+ public function setPatternWithDigits($patternWithDigits = null)
+ {
+ $this->patternWithDigits = $patternWithDigits;
+
+ return $this;
+ }
+
+ /**
+ * Gets patternWithDigitsAndDelimiter.
+ *
+ * @return string|null
+ */
+ public function getPatternWithDigitsAndDelimiter()
+ {
+ return $this->patternWithDigitsAndDelimiter;
+ }
+
+ /**
+ * Sets patternWithDigitsAndDelimiter.
+ *
+ * @param string|null $patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
+ *
+ * @return $this
+ */
+ public function setPatternWithDigitsAndDelimiter($patternWithDigitsAndDelimiter = null)
+ {
+ $this->patternWithDigitsAndDelimiter = $patternWithDigitsAndDelimiter;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HasOnlyReadOnly.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HasOnlyReadOnly.php
new file mode 100644
index 000000000000..e2ec780d620c
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HasOnlyReadOnly.php
@@ -0,0 +1,119 @@
+bar = isset($data['bar']) ? $data['bar'] : null;
+ $this->foo = isset($data['foo']) ? $data['foo'] : null;
+ }
+
+ /**
+ * Gets bar.
+ *
+ * @return string|null
+ */
+ public function getBar()
+ {
+ return $this->bar;
+ }
+
+ /**
+ * Sets bar.
+ *
+ * @param string|null $bar
+ *
+ * @return $this
+ */
+ public function setBar($bar = null)
+ {
+ $this->bar = $bar;
+
+ return $this;
+ }
+
+ /**
+ * Gets foo.
+ *
+ * @return string|null
+ */
+ public function getFoo()
+ {
+ return $this->foo;
+ }
+
+ /**
+ * Sets foo.
+ *
+ * @param string|null $foo
+ *
+ * @return $this
+ */
+ public function setFoo($foo = null)
+ {
+ $this->foo = $foo;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HealthCheckResult.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HealthCheckResult.php
new file mode 100644
index 000000000000..25926747e849
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/HealthCheckResult.php
@@ -0,0 +1,88 @@
+nullableMessage = isset($data['nullableMessage']) ? $data['nullableMessage'] : null;
+ }
+
+ /**
+ * Gets nullableMessage.
+ *
+ * @return string|null
+ */
+ public function getNullableMessage()
+ {
+ return $this->nullableMessage;
+ }
+
+ /**
+ * Sets nullableMessage.
+ *
+ * @param string|null $nullableMessage
+ *
+ * @return $this
+ */
+ public function setNullableMessage($nullableMessage = null)
+ {
+ $this->nullableMessage = $nullableMessage;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject.php
new file mode 100644
index 000000000000..ce089a25b774
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject.php
@@ -0,0 +1,123 @@
+name = isset($data['name']) ? $data['name'] : null;
+ $this->status = isset($data['status']) ? $data['status'] : null;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return string|null
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param string|null $name Updated name of the pet
+ *
+ * @return $this
+ */
+ public function setName($name = null)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets status.
+ *
+ * @return string|null
+ */
+ public function getStatus()
+ {
+ return $this->status;
+ }
+
+ /**
+ * Sets status.
+ *
+ * @param string|null $status Updated status of the pet
+ *
+ * @return $this
+ */
+ public function setStatus($status = null)
+ {
+ $this->status = $status;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject1.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject1.php
new file mode 100644
index 000000000000..4b7ea11a1362
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject1.php
@@ -0,0 +1,123 @@
+additionalMetadata = isset($data['additionalMetadata']) ? $data['additionalMetadata'] : null;
+ $this->file = isset($data['file']) ? $data['file'] : null;
+ }
+
+ /**
+ * Gets additionalMetadata.
+ *
+ * @return string|null
+ */
+ public function getAdditionalMetadata()
+ {
+ return $this->additionalMetadata;
+ }
+
+ /**
+ * Sets additionalMetadata.
+ *
+ * @param string|null $additionalMetadata Additional data to pass to server
+ *
+ * @return $this
+ */
+ public function setAdditionalMetadata($additionalMetadata = null)
+ {
+ $this->additionalMetadata = $additionalMetadata;
+
+ return $this;
+ }
+
+ /**
+ * Gets file.
+ *
+ * @return UploadedFile|null
+ */
+ public function getFile(): ?UploadedFile
+ {
+ return $this->file;
+ }
+
+ /**
+ * Sets file.
+ *
+ * @param UploadedFile|null $file file to upload
+ *
+ * @return $this
+ */
+ public function setFile(UploadedFile $file = null)
+ {
+ $this->file = $file;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject2.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject2.php
new file mode 100644
index 000000000000..7de1017e52d9
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject2.php
@@ -0,0 +1,129 @@
+", "$" })
+ * })
+ * @Assert\All({
+ * @Assert\Type("string")
+ * })
+ * @Type("array")
+ */
+ protected $enumFormStringArray;
+
+ /**
+ * Form parameter enum test (string)
+ *
+ * @var string|null
+ * @SerializedName("enum_form_string")
+ * @Assert\Choice({ "_abc", "-efg", "(xyz)" })
+ * @Assert\Type("string")
+ * @Type("string")
+ */
+ protected $enumFormString;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->enumFormStringArray = isset($data['enumFormStringArray']) ? $data['enumFormStringArray'] : null;
+ $this->enumFormString = isset($data['enumFormString']) ? $data['enumFormString'] : '-efg';
+ }
+
+ /**
+ * Gets enumFormStringArray.
+ *
+ * @return string[]|null
+ */
+ public function getEnumFormStringArray(): ?array
+ {
+ return $this->enumFormStringArray;
+ }
+
+ /**
+ * Sets enumFormStringArray.
+ *
+ * @param string[]|null $enumFormStringArray Form parameter enum test (string array)
+ *
+ * @return $this
+ */
+ public function setEnumFormStringArray(array $enumFormStringArray = null)
+ {
+ $this->enumFormStringArray = $enumFormStringArray;
+
+ return $this;
+ }
+
+ /**
+ * Gets enumFormString.
+ *
+ * @return string|null
+ */
+ public function getEnumFormString()
+ {
+ return $this->enumFormString;
+ }
+
+ /**
+ * Sets enumFormString.
+ *
+ * @param string|null $enumFormString Form parameter enum test (string)
+ *
+ * @return $this
+ */
+ public function setEnumFormString($enumFormString = null)
+ {
+ $this->enumFormString = $enumFormString;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject3.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject3.php
new file mode 100644
index 000000000000..cc18a7cfb9dd
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject3.php
@@ -0,0 +1,564 @@
+integer = isset($data['integer']) ? $data['integer'] : null;
+ $this->int32 = isset($data['int32']) ? $data['int32'] : null;
+ $this->int64 = isset($data['int64']) ? $data['int64'] : null;
+ $this->number = isset($data['number']) ? $data['number'] : null;
+ $this->float = isset($data['float']) ? $data['float'] : null;
+ $this->double = isset($data['double']) ? $data['double'] : null;
+ $this->string = isset($data['string']) ? $data['string'] : null;
+ $this->patternWithoutDelimiter = isset($data['patternWithoutDelimiter']) ? $data['patternWithoutDelimiter'] : null;
+ $this->byte = isset($data['byte']) ? $data['byte'] : null;
+ $this->binary = isset($data['binary']) ? $data['binary'] : null;
+ $this->date = isset($data['date']) ? $data['date'] : null;
+ $this->dateTime = isset($data['dateTime']) ? $data['dateTime'] : null;
+ $this->password = isset($data['password']) ? $data['password'] : null;
+ $this->callback = isset($data['callback']) ? $data['callback'] : null;
+ }
+
+ /**
+ * Gets integer.
+ *
+ * @return int|null
+ */
+ public function getInteger()
+ {
+ return $this->integer;
+ }
+
+ /**
+ * Sets integer.
+ *
+ * @param int|null $integer None
+ *
+ * @return $this
+ */
+ public function setInteger($integer = null)
+ {
+ $this->integer = $integer;
+
+ return $this;
+ }
+
+ /**
+ * Gets int32.
+ *
+ * @return int|null
+ */
+ public function getInt32()
+ {
+ return $this->int32;
+ }
+
+ /**
+ * Sets int32.
+ *
+ * @param int|null $int32 None
+ *
+ * @return $this
+ */
+ public function setInt32($int32 = null)
+ {
+ $this->int32 = $int32;
+
+ return $this;
+ }
+
+ /**
+ * Gets int64.
+ *
+ * @return int|null
+ */
+ public function getInt64()
+ {
+ return $this->int64;
+ }
+
+ /**
+ * Sets int64.
+ *
+ * @param int|null $int64 None
+ *
+ * @return $this
+ */
+ public function setInt64($int64 = null)
+ {
+ $this->int64 = $int64;
+
+ return $this;
+ }
+
+ /**
+ * Gets number.
+ *
+ * @return float
+ */
+ public function getNumber()
+ {
+ return $this->number;
+ }
+
+ /**
+ * Sets number.
+ *
+ * @param float $number None
+ *
+ * @return $this
+ */
+ public function setNumber($number)
+ {
+ $this->number = $number;
+
+ return $this;
+ }
+
+ /**
+ * Gets float.
+ *
+ * @return float|null
+ */
+ public function getFloat()
+ {
+ return $this->float;
+ }
+
+ /**
+ * Sets float.
+ *
+ * @param float|null $float None
+ *
+ * @return $this
+ */
+ public function setFloat($float = null)
+ {
+ $this->float = $float;
+
+ return $this;
+ }
+
+ /**
+ * Gets double.
+ *
+ * @return double
+ */
+ public function getDouble()
+ {
+ return $this->double;
+ }
+
+ /**
+ * Sets double.
+ *
+ * @param double $double None
+ *
+ * @return $this
+ */
+ public function setDouble($double)
+ {
+ $this->double = $double;
+
+ return $this;
+ }
+
+ /**
+ * Gets string.
+ *
+ * @return string|null
+ */
+ public function getString()
+ {
+ return $this->string;
+ }
+
+ /**
+ * Sets string.
+ *
+ * @param string|null $string None
+ *
+ * @return $this
+ */
+ public function setString($string = null)
+ {
+ $this->string = $string;
+
+ return $this;
+ }
+
+ /**
+ * Gets patternWithoutDelimiter.
+ *
+ * @return string
+ */
+ public function getPatternWithoutDelimiter()
+ {
+ return $this->patternWithoutDelimiter;
+ }
+
+ /**
+ * Sets patternWithoutDelimiter.
+ *
+ * @param string $patternWithoutDelimiter None
+ *
+ * @return $this
+ */
+ public function setPatternWithoutDelimiter($patternWithoutDelimiter)
+ {
+ $this->patternWithoutDelimiter = $patternWithoutDelimiter;
+
+ return $this;
+ }
+
+ /**
+ * Gets byte.
+ *
+ * @return string
+ */
+ public function getByte()
+ {
+ return $this->byte;
+ }
+
+ /**
+ * Sets byte.
+ *
+ * @param string $byte None
+ *
+ * @return $this
+ */
+ public function setByte($byte)
+ {
+ $this->byte = $byte;
+
+ return $this;
+ }
+
+ /**
+ * Gets binary.
+ *
+ * @return UploadedFile|null
+ */
+ public function getBinary(): ?UploadedFile
+ {
+ return $this->binary;
+ }
+
+ /**
+ * Sets binary.
+ *
+ * @param UploadedFile|null $binary None
+ *
+ * @return $this
+ */
+ public function setBinary(UploadedFile $binary = null)
+ {
+ $this->binary = $binary;
+
+ return $this;
+ }
+
+ /**
+ * Gets date.
+ *
+ * @return \DateTime|null
+ */
+ public function getDate(): ?\DateTime
+ {
+ return $this->date;
+ }
+
+ /**
+ * Sets date.
+ *
+ * @param \DateTime|null $date None
+ *
+ * @return $this
+ */
+ public function setDate(\DateTime $date = null)
+ {
+ $this->date = $date;
+
+ return $this;
+ }
+
+ /**
+ * Gets dateTime.
+ *
+ * @return \DateTime|null
+ */
+ public function getDateTime(): ?\DateTime
+ {
+ return $this->dateTime;
+ }
+
+ /**
+ * Sets dateTime.
+ *
+ * @param \DateTime|null $dateTime None
+ *
+ * @return $this
+ */
+ public function setDateTime(\DateTime $dateTime = null)
+ {
+ $this->dateTime = $dateTime;
+
+ return $this;
+ }
+
+ /**
+ * Gets password.
+ *
+ * @return string|null
+ */
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ /**
+ * Sets password.
+ *
+ * @param string|null $password None
+ *
+ * @return $this
+ */
+ public function setPassword($password = null)
+ {
+ $this->password = $password;
+
+ return $this;
+ }
+
+ /**
+ * Gets callback.
+ *
+ * @return string|null
+ */
+ public function getCallback()
+ {
+ return $this->callback;
+ }
+
+ /**
+ * Sets callback.
+ *
+ * @param string|null $callback None
+ *
+ * @return $this
+ */
+ public function setCallback($callback = null)
+ {
+ $this->callback = $callback;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject4.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject4.php
new file mode 100644
index 000000000000..495b44032e9a
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject4.php
@@ -0,0 +1,125 @@
+param = isset($data['param']) ? $data['param'] : null;
+ $this->param2 = isset($data['param2']) ? $data['param2'] : null;
+ }
+
+ /**
+ * Gets param.
+ *
+ * @return string
+ */
+ public function getParam()
+ {
+ return $this->param;
+ }
+
+ /**
+ * Sets param.
+ *
+ * @param string $param field1
+ *
+ * @return $this
+ */
+ public function setParam($param)
+ {
+ $this->param = $param;
+
+ return $this;
+ }
+
+ /**
+ * Gets param2.
+ *
+ * @return string
+ */
+ public function getParam2()
+ {
+ return $this->param2;
+ }
+
+ /**
+ * Sets param2.
+ *
+ * @param string $param2 field2
+ *
+ * @return $this
+ */
+ public function setParam2($param2)
+ {
+ $this->param2 = $param2;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject5.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject5.php
new file mode 100644
index 000000000000..7f407d028b42
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineObject5.php
@@ -0,0 +1,124 @@
+additionalMetadata = isset($data['additionalMetadata']) ? $data['additionalMetadata'] : null;
+ $this->requiredFile = isset($data['requiredFile']) ? $data['requiredFile'] : null;
+ }
+
+ /**
+ * Gets additionalMetadata.
+ *
+ * @return string|null
+ */
+ public function getAdditionalMetadata()
+ {
+ return $this->additionalMetadata;
+ }
+
+ /**
+ * Sets additionalMetadata.
+ *
+ * @param string|null $additionalMetadata Additional data to pass to server
+ *
+ * @return $this
+ */
+ public function setAdditionalMetadata($additionalMetadata = null)
+ {
+ $this->additionalMetadata = $additionalMetadata;
+
+ return $this;
+ }
+
+ /**
+ * Gets requiredFile.
+ *
+ * @return UploadedFile
+ */
+ public function getRequiredFile(): UploadedFile
+ {
+ return $this->requiredFile;
+ }
+
+ /**
+ * Sets requiredFile.
+ *
+ * @param UploadedFile $requiredFile file to upload
+ *
+ * @return $this
+ */
+ public function setRequiredFile(UploadedFile $requiredFile)
+ {
+ $this->requiredFile = $requiredFile;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineResponseDefault.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineResponseDefault.php
new file mode 100644
index 000000000000..c459ab25e2b6
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/InlineResponseDefault.php
@@ -0,0 +1,86 @@
+string = isset($data['string']) ? $data['string'] : null;
+ }
+
+ /**
+ * Gets string.
+ *
+ * @return OpenAPI\Server\Model\Foo|null
+ */
+ public function getString(): ?Foo
+ {
+ return $this->string;
+ }
+
+ /**
+ * Sets string.
+ *
+ * @param OpenAPI\Server\Model\Foo|null $string
+ *
+ * @return $this
+ */
+ public function setString(Foo $string = null)
+ {
+ $this->string = $string;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MapTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MapTest.php
new file mode 100644
index 000000000000..a9a6a198ab5e
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MapTest.php
@@ -0,0 +1,196 @@
+")
+ */
+ protected $mapMapOfString;
+
+ /**
+ * @var string[]|null
+ * @SerializedName("map_of_enum_string")
+ * @Assert\All({
+ * @Assert\Choice({ "UPPER", "lower" })
+ * })
+ * @Assert\All({
+ * @Assert\Type("string")
+ * })
+ * @Type("array")
+ */
+ protected $mapOfEnumString;
+
+ /**
+ * @var bool[]|null
+ * @SerializedName("direct_map")
+ * @Assert\All({
+ * @Assert\Type("bool")
+ * })
+ * @Type("array")
+ */
+ protected $directMap;
+
+ /**
+ * @var bool[]|null
+ * @SerializedName("indirect_map")
+ * @Assert\All({
+ * @Assert\Type("bool")
+ * })
+ * @Type("array")
+ */
+ protected $indirectMap;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->mapMapOfString = isset($data['mapMapOfString']) ? $data['mapMapOfString'] : null;
+ $this->mapOfEnumString = isset($data['mapOfEnumString']) ? $data['mapOfEnumString'] : null;
+ $this->directMap = isset($data['directMap']) ? $data['directMap'] : null;
+ $this->indirectMap = isset($data['indirectMap']) ? $data['indirectMap'] : null;
+ }
+
+ /**
+ * Gets mapMapOfString.
+ *
+ * @return string[]|null
+ */
+ public function getMapMapOfString(): ?array
+ {
+ return $this->mapMapOfString;
+ }
+
+ /**
+ * Sets mapMapOfString.
+ *
+ * @param string[]|null $mapMapOfString
+ *
+ * @return $this
+ */
+ public function setMapMapOfString(array $mapMapOfString = null)
+ {
+ $this->mapMapOfString = $mapMapOfString;
+
+ return $this;
+ }
+
+ /**
+ * Gets mapOfEnumString.
+ *
+ * @return string[]|null
+ */
+ public function getMapOfEnumString(): ?array
+ {
+ return $this->mapOfEnumString;
+ }
+
+ /**
+ * Sets mapOfEnumString.
+ *
+ * @param string[]|null $mapOfEnumString
+ *
+ * @return $this
+ */
+ public function setMapOfEnumString(array $mapOfEnumString = null)
+ {
+ $this->mapOfEnumString = $mapOfEnumString;
+
+ return $this;
+ }
+
+ /**
+ * Gets directMap.
+ *
+ * @return bool[]|null
+ */
+ public function getDirectMap(): ?array
+ {
+ return $this->directMap;
+ }
+
+ /**
+ * Sets directMap.
+ *
+ * @param bool[]|null $directMap
+ *
+ * @return $this
+ */
+ public function setDirectMap(array $directMap = null)
+ {
+ $this->directMap = $directMap;
+
+ return $this;
+ }
+
+ /**
+ * Gets indirectMap.
+ *
+ * @return bool[]|null
+ */
+ public function getIndirectMap(): ?array
+ {
+ return $this->indirectMap;
+ }
+
+ /**
+ * Sets indirectMap.
+ *
+ * @param bool[]|null $indirectMap
+ *
+ * @return $this
+ */
+ public function setIndirectMap(array $indirectMap = null)
+ {
+ $this->indirectMap = $indirectMap;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MixedPropertiesAndAdditionalPropertiesClass.php
new file mode 100644
index 000000000000..41c2841c3710
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/MixedPropertiesAndAdditionalPropertiesClass.php
@@ -0,0 +1,154 @@
+")
+ */
+ protected $map;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->uuid = isset($data['uuid']) ? $data['uuid'] : null;
+ $this->dateTime = isset($data['dateTime']) ? $data['dateTime'] : null;
+ $this->map = isset($data['map']) ? $data['map'] : null;
+ }
+
+ /**
+ * Gets uuid.
+ *
+ * @return string|null
+ */
+ public function getUuid()
+ {
+ return $this->uuid;
+ }
+
+ /**
+ * Sets uuid.
+ *
+ * @param string|null $uuid
+ *
+ * @return $this
+ */
+ public function setUuid($uuid = null)
+ {
+ $this->uuid = $uuid;
+
+ return $this;
+ }
+
+ /**
+ * Gets dateTime.
+ *
+ * @return \DateTime|null
+ */
+ public function getDateTime(): ?\DateTime
+ {
+ return $this->dateTime;
+ }
+
+ /**
+ * Sets dateTime.
+ *
+ * @param \DateTime|null $dateTime
+ *
+ * @return $this
+ */
+ public function setDateTime(\DateTime $dateTime = null)
+ {
+ $this->dateTime = $dateTime;
+
+ return $this;
+ }
+
+ /**
+ * Gets map.
+ *
+ * @return OpenAPI\Server\Model\Animal[]|null
+ */
+ public function getMap(): ?array
+ {
+ return $this->map;
+ }
+
+ /**
+ * Sets map.
+ *
+ * @param OpenAPI\Server\Model\Animal[]|null $map
+ *
+ * @return $this
+ */
+ public function setMap(array $map = null)
+ {
+ $this->map = $map;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Model200Response.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Model200Response.php
new file mode 100644
index 000000000000..28e2f3c113fb
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Model200Response.php
@@ -0,0 +1,121 @@
+name = isset($data['name']) ? $data['name'] : null;
+ $this->class = isset($data['class']) ? $data['class'] : null;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return int|null
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param int|null $name
+ *
+ * @return $this
+ */
+ public function setName($name = null)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets class.
+ *
+ * @return string|null
+ */
+ public function getClass()
+ {
+ return $this->class;
+ }
+
+ /**
+ * Sets class.
+ *
+ * @param string|null $class
+ *
+ * @return $this
+ */
+ public function setClass($class = null)
+ {
+ $this->class = $class;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelList.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelList.php
new file mode 100644
index 000000000000..766afc6f9817
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelList.php
@@ -0,0 +1,86 @@
+_123list = isset($data['_123list']) ? $data['_123list'] : null;
+ }
+
+ /**
+ * Gets _123list.
+ *
+ * @return string|null
+ */
+ public function get123list()
+ {
+ return $this->_123list;
+ }
+
+ /**
+ * Sets _123list.
+ *
+ * @param string|null $_123list
+ *
+ * @return $this
+ */
+ public function set123list($_123list = null)
+ {
+ $this->_123list = $_123list;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelReturn.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelReturn.php
new file mode 100644
index 000000000000..398443da1b19
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ModelReturn.php
@@ -0,0 +1,88 @@
+return = isset($data['return']) ? $data['return'] : null;
+ }
+
+ /**
+ * Gets return.
+ *
+ * @return int|null
+ */
+ public function getReturn()
+ {
+ return $this->return;
+ }
+
+ /**
+ * Sets return.
+ *
+ * @param int|null $return
+ *
+ * @return $this
+ */
+ public function setReturn($return = null)
+ {
+ $this->return = $return;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Name.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Name.php
new file mode 100644
index 000000000000..5f32a7628c4f
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Name.php
@@ -0,0 +1,188 @@
+name = isset($data['name']) ? $data['name'] : null;
+ $this->snakeCase = isset($data['snakeCase']) ? $data['snakeCase'] : null;
+ $this->property = isset($data['property']) ? $data['property'] : null;
+ $this->_123number = isset($data['_123number']) ? $data['_123number'] : null;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return int
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param int $name
+ *
+ * @return $this
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets snakeCase.
+ *
+ * @return int|null
+ */
+ public function getSnakeCase()
+ {
+ return $this->snakeCase;
+ }
+
+ /**
+ * Sets snakeCase.
+ *
+ * @param int|null $snakeCase
+ *
+ * @return $this
+ */
+ public function setSnakeCase($snakeCase = null)
+ {
+ $this->snakeCase = $snakeCase;
+
+ return $this;
+ }
+
+ /**
+ * Gets property.
+ *
+ * @return string|null
+ */
+ public function getProperty()
+ {
+ return $this->property;
+ }
+
+ /**
+ * Sets property.
+ *
+ * @param string|null $property
+ *
+ * @return $this
+ */
+ public function setProperty($property = null)
+ {
+ $this->property = $property;
+
+ return $this;
+ }
+
+ /**
+ * Gets _123number.
+ *
+ * @return int|null
+ */
+ public function get123number()
+ {
+ return $this->_123number;
+ }
+
+ /**
+ * Sets _123number.
+ *
+ * @param int|null $_123number
+ *
+ * @return $this
+ */
+ public function set123number($_123number = null)
+ {
+ $this->_123number = $_123number;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NullableClass.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NullableClass.php
new file mode 100644
index 000000000000..2a389270733b
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NullableClass.php
@@ -0,0 +1,461 @@
+")
+ */
+ protected $arrayNullableProp;
+
+ /**
+ * @var array[]|null
+ * @SerializedName("array_and_items_nullable_prop")
+ * @Assert\All({
+ * @Assert\Type("array")
+ * })
+ * @Type("array")
+ */
+ protected $arrayAndItemsNullableProp;
+
+ /**
+ * @var array[]|null
+ * @SerializedName("array_items_nullable")
+ * @Assert\All({
+ * @Assert\Type("array")
+ * })
+ * @Type("array")
+ */
+ protected $arrayItemsNullable;
+
+ /**
+ * @var array[]|null
+ * @SerializedName("object_nullable_prop")
+ * @Assert\All({
+ * @Assert\Type("array")
+ * })
+ * @Type("array")
+ */
+ protected $objectNullableProp;
+
+ /**
+ * @var array[]|null
+ * @SerializedName("object_and_items_nullable_prop")
+ * @Assert\All({
+ * @Assert\Type("array")
+ * })
+ * @Type("array")
+ */
+ protected $objectAndItemsNullableProp;
+
+ /**
+ * @var array[]|null
+ * @SerializedName("object_items_nullable")
+ * @Assert\All({
+ * @Assert\Type("array")
+ * })
+ * @Type("array")
+ */
+ protected $objectItemsNullable;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->integerProp = isset($data['integerProp']) ? $data['integerProp'] : null;
+ $this->numberProp = isset($data['numberProp']) ? $data['numberProp'] : null;
+ $this->booleanProp = isset($data['booleanProp']) ? $data['booleanProp'] : null;
+ $this->stringProp = isset($data['stringProp']) ? $data['stringProp'] : null;
+ $this->dateProp = isset($data['dateProp']) ? $data['dateProp'] : null;
+ $this->datetimeProp = isset($data['datetimeProp']) ? $data['datetimeProp'] : null;
+ $this->arrayNullableProp = isset($data['arrayNullableProp']) ? $data['arrayNullableProp'] : null;
+ $this->arrayAndItemsNullableProp = isset($data['arrayAndItemsNullableProp']) ? $data['arrayAndItemsNullableProp'] : null;
+ $this->arrayItemsNullable = isset($data['arrayItemsNullable']) ? $data['arrayItemsNullable'] : null;
+ $this->objectNullableProp = isset($data['objectNullableProp']) ? $data['objectNullableProp'] : null;
+ $this->objectAndItemsNullableProp = isset($data['objectAndItemsNullableProp']) ? $data['objectAndItemsNullableProp'] : null;
+ $this->objectItemsNullable = isset($data['objectItemsNullable']) ? $data['objectItemsNullable'] : null;
+ }
+
+ /**
+ * Gets integerProp.
+ *
+ * @return int|null
+ */
+ public function getIntegerProp()
+ {
+ return $this->integerProp;
+ }
+
+ /**
+ * Sets integerProp.
+ *
+ * @param int|null $integerProp
+ *
+ * @return $this
+ */
+ public function setIntegerProp($integerProp = null)
+ {
+ $this->integerProp = $integerProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets numberProp.
+ *
+ * @return float|null
+ */
+ public function getNumberProp()
+ {
+ return $this->numberProp;
+ }
+
+ /**
+ * Sets numberProp.
+ *
+ * @param float|null $numberProp
+ *
+ * @return $this
+ */
+ public function setNumberProp($numberProp = null)
+ {
+ $this->numberProp = $numberProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets booleanProp.
+ *
+ * @return bool|null
+ */
+ public function isBooleanProp()
+ {
+ return $this->booleanProp;
+ }
+
+ /**
+ * Sets booleanProp.
+ *
+ * @param bool|null $booleanProp
+ *
+ * @return $this
+ */
+ public function setBooleanProp($booleanProp = null)
+ {
+ $this->booleanProp = $booleanProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets stringProp.
+ *
+ * @return string|null
+ */
+ public function getStringProp()
+ {
+ return $this->stringProp;
+ }
+
+ /**
+ * Sets stringProp.
+ *
+ * @param string|null $stringProp
+ *
+ * @return $this
+ */
+ public function setStringProp($stringProp = null)
+ {
+ $this->stringProp = $stringProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets dateProp.
+ *
+ * @return \DateTime|null
+ */
+ public function getDateProp(): ?\DateTime
+ {
+ return $this->dateProp;
+ }
+
+ /**
+ * Sets dateProp.
+ *
+ * @param \DateTime|null $dateProp
+ *
+ * @return $this
+ */
+ public function setDateProp(\DateTime $dateProp = null)
+ {
+ $this->dateProp = $dateProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets datetimeProp.
+ *
+ * @return \DateTime|null
+ */
+ public function getDatetimeProp(): ?\DateTime
+ {
+ return $this->datetimeProp;
+ }
+
+ /**
+ * Sets datetimeProp.
+ *
+ * @param \DateTime|null $datetimeProp
+ *
+ * @return $this
+ */
+ public function setDatetimeProp(\DateTime $datetimeProp = null)
+ {
+ $this->datetimeProp = $datetimeProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayNullableProp.
+ *
+ * @return array[]|null
+ */
+ public function getArrayNullableProp(): ?array
+ {
+ return $this->arrayNullableProp;
+ }
+
+ /**
+ * Sets arrayNullableProp.
+ *
+ * @param array[]|null $arrayNullableProp
+ *
+ * @return $this
+ */
+ public function setArrayNullableProp(array $arrayNullableProp = null)
+ {
+ $this->arrayNullableProp = $arrayNullableProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayAndItemsNullableProp.
+ *
+ * @return array[]|null
+ */
+ public function getArrayAndItemsNullableProp(): ?array
+ {
+ return $this->arrayAndItemsNullableProp;
+ }
+
+ /**
+ * Sets arrayAndItemsNullableProp.
+ *
+ * @param array[]|null $arrayAndItemsNullableProp
+ *
+ * @return $this
+ */
+ public function setArrayAndItemsNullableProp(array $arrayAndItemsNullableProp = null)
+ {
+ $this->arrayAndItemsNullableProp = $arrayAndItemsNullableProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets arrayItemsNullable.
+ *
+ * @return array[]|null
+ */
+ public function getArrayItemsNullable(): ?array
+ {
+ return $this->arrayItemsNullable;
+ }
+
+ /**
+ * Sets arrayItemsNullable.
+ *
+ * @param array[]|null $arrayItemsNullable
+ *
+ * @return $this
+ */
+ public function setArrayItemsNullable(array $arrayItemsNullable = null)
+ {
+ $this->arrayItemsNullable = $arrayItemsNullable;
+
+ return $this;
+ }
+
+ /**
+ * Gets objectNullableProp.
+ *
+ * @return array[]|null
+ */
+ public function getObjectNullableProp(): ?array
+ {
+ return $this->objectNullableProp;
+ }
+
+ /**
+ * Sets objectNullableProp.
+ *
+ * @param array[]|null $objectNullableProp
+ *
+ * @return $this
+ */
+ public function setObjectNullableProp(array $objectNullableProp = null)
+ {
+ $this->objectNullableProp = $objectNullableProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets objectAndItemsNullableProp.
+ *
+ * @return array[]|null
+ */
+ public function getObjectAndItemsNullableProp(): ?array
+ {
+ return $this->objectAndItemsNullableProp;
+ }
+
+ /**
+ * Sets objectAndItemsNullableProp.
+ *
+ * @param array[]|null $objectAndItemsNullableProp
+ *
+ * @return $this
+ */
+ public function setObjectAndItemsNullableProp(array $objectAndItemsNullableProp = null)
+ {
+ $this->objectAndItemsNullableProp = $objectAndItemsNullableProp;
+
+ return $this;
+ }
+
+ /**
+ * Gets objectItemsNullable.
+ *
+ * @return array[]|null
+ */
+ public function getObjectItemsNullable(): ?array
+ {
+ return $this->objectItemsNullable;
+ }
+
+ /**
+ * Sets objectItemsNullable.
+ *
+ * @param array[]|null $objectItemsNullable
+ *
+ * @return $this
+ */
+ public function setObjectItemsNullable(array $objectItemsNullable = null)
+ {
+ $this->objectItemsNullable = $objectItemsNullable;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NumberOnly.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NumberOnly.php
new file mode 100644
index 000000000000..be4715811266
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/NumberOnly.php
@@ -0,0 +1,86 @@
+justNumber = isset($data['justNumber']) ? $data['justNumber'] : null;
+ }
+
+ /**
+ * Gets justNumber.
+ *
+ * @return float|null
+ */
+ public function getJustNumber()
+ {
+ return $this->justNumber;
+ }
+
+ /**
+ * Sets justNumber.
+ *
+ * @param float|null $justNumber
+ *
+ * @return $this
+ */
+ public function setJustNumber($justNumber = null)
+ {
+ $this->justNumber = $justNumber;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Order.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Order.php
new file mode 100644
index 000000000000..ad2edd319f2b
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Order.php
@@ -0,0 +1,254 @@
+id = isset($data['id']) ? $data['id'] : null;
+ $this->petId = isset($data['petId']) ? $data['petId'] : null;
+ $this->quantity = isset($data['quantity']) ? $data['quantity'] : null;
+ $this->shipDate = isset($data['shipDate']) ? $data['shipDate'] : null;
+ $this->status = isset($data['status']) ? $data['status'] : null;
+ $this->complete = isset($data['complete']) ? $data['complete'] : false;
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return int|null
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets id.
+ *
+ * @param int|null $id
+ *
+ * @return $this
+ */
+ public function setId($id = null)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets petId.
+ *
+ * @return int|null
+ */
+ public function getPetId()
+ {
+ return $this->petId;
+ }
+
+ /**
+ * Sets petId.
+ *
+ * @param int|null $petId
+ *
+ * @return $this
+ */
+ public function setPetId($petId = null)
+ {
+ $this->petId = $petId;
+
+ return $this;
+ }
+
+ /**
+ * Gets quantity.
+ *
+ * @return int|null
+ */
+ public function getQuantity()
+ {
+ return $this->quantity;
+ }
+
+ /**
+ * Sets quantity.
+ *
+ * @param int|null $quantity
+ *
+ * @return $this
+ */
+ public function setQuantity($quantity = null)
+ {
+ $this->quantity = $quantity;
+
+ return $this;
+ }
+
+ /**
+ * Gets shipDate.
+ *
+ * @return \DateTime|null
+ */
+ public function getShipDate(): ?\DateTime
+ {
+ return $this->shipDate;
+ }
+
+ /**
+ * Sets shipDate.
+ *
+ * @param \DateTime|null $shipDate
+ *
+ * @return $this
+ */
+ public function setShipDate(\DateTime $shipDate = null)
+ {
+ $this->shipDate = $shipDate;
+
+ return $this;
+ }
+
+ /**
+ * Gets status.
+ *
+ * @return string|null
+ */
+ public function getStatus()
+ {
+ return $this->status;
+ }
+
+ /**
+ * Sets status.
+ *
+ * @param string|null $status Order Status
+ *
+ * @return $this
+ */
+ public function setStatus($status = null)
+ {
+ $this->status = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets complete.
+ *
+ * @return bool|null
+ */
+ public function isComplete()
+ {
+ return $this->complete;
+ }
+
+ /**
+ * Sets complete.
+ *
+ * @param bool|null $complete
+ *
+ * @return $this
+ */
+ public function setComplete($complete = null)
+ {
+ $this->complete = $complete;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterComposite.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterComposite.php
new file mode 100644
index 000000000000..151ab1d18220
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterComposite.php
@@ -0,0 +1,152 @@
+myNumber = isset($data['myNumber']) ? $data['myNumber'] : null;
+ $this->myString = isset($data['myString']) ? $data['myString'] : null;
+ $this->myBoolean = isset($data['myBoolean']) ? $data['myBoolean'] : null;
+ }
+
+ /**
+ * Gets myNumber.
+ *
+ * @return float|null
+ */
+ public function getMyNumber()
+ {
+ return $this->myNumber;
+ }
+
+ /**
+ * Sets myNumber.
+ *
+ * @param float|null $myNumber
+ *
+ * @return $this
+ */
+ public function setMyNumber($myNumber = null)
+ {
+ $this->myNumber = $myNumber;
+
+ return $this;
+ }
+
+ /**
+ * Gets myString.
+ *
+ * @return string|null
+ */
+ public function getMyString()
+ {
+ return $this->myString;
+ }
+
+ /**
+ * Sets myString.
+ *
+ * @param string|null $myString
+ *
+ * @return $this
+ */
+ public function setMyString($myString = null)
+ {
+ $this->myString = $myString;
+
+ return $this;
+ }
+
+ /**
+ * Gets myBoolean.
+ *
+ * @return bool|null
+ */
+ public function isMyBoolean()
+ {
+ return $this->myBoolean;
+ }
+
+ /**
+ * Sets myBoolean.
+ *
+ * @param bool|null $myBoolean
+ *
+ * @return $this
+ */
+ public function setMyBoolean($myBoolean = null)
+ {
+ $this->myBoolean = $myBoolean;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterEnum.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterEnum.php
new file mode 100644
index 000000000000..81bf2fd2531d
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/OuterEnum.php
@@ -0,0 +1,53 @@
+")
+ */
+ protected $photoUrls;
+
+ /**
+ * @var OpenAPI\Server\Model\Tag[]|null
+ * @SerializedName("tags")
+ * @Assert\All({
+ * @Assert\Type("OpenAPI\Server\Model\Tag")
+ * })
+ * @Type("array")
+ */
+ protected $tags;
+
+ /**
+ * pet status in the store
+ *
+ * @var string|null
+ * @SerializedName("status")
+ * @Assert\Choice({ "available", "pending", "sold" })
+ * @Assert\Type("string")
+ * @Type("string")
+ */
+ protected $status;
+
+ /**
+ * Constructor
+ * @param mixed[] $data Associated array of property values initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->id = isset($data['id']) ? $data['id'] : null;
+ $this->category = isset($data['category']) ? $data['category'] : null;
+ $this->name = isset($data['name']) ? $data['name'] : null;
+ $this->photoUrls = isset($data['photoUrls']) ? $data['photoUrls'] : null;
+ $this->tags = isset($data['tags']) ? $data['tags'] : null;
+ $this->status = isset($data['status']) ? $data['status'] : null;
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return int|null
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets id.
+ *
+ * @param int|null $id
+ *
+ * @return $this
+ */
+ public function setId($id = null)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets category.
+ *
+ * @return OpenAPI\Server\Model\Category|null
+ */
+ public function getCategory(): ?Category
+ {
+ return $this->category;
+ }
+
+ /**
+ * Sets category.
+ *
+ * @param OpenAPI\Server\Model\Category|null $category
+ *
+ * @return $this
+ */
+ public function setCategory(Category $category = null)
+ {
+ $this->category = $category;
+
+ return $this;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param string $name
+ *
+ * @return $this
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets photoUrls.
+ *
+ * @return string[]
+ */
+ public function getPhotoUrls(): array
+ {
+ return $this->photoUrls;
+ }
+
+ /**
+ * Sets photoUrls.
+ *
+ * @param string[] $photoUrls
+ *
+ * @return $this
+ */
+ public function setPhotoUrls(array $photoUrls)
+ {
+ $this->photoUrls = $photoUrls;
+
+ return $this;
+ }
+
+ /**
+ * Gets tags.
+ *
+ * @return OpenAPI\Server\Model\Tag[]|null
+ */
+ public function getTags(): ?array
+ {
+ return $this->tags;
+ }
+
+ /**
+ * Sets tags.
+ *
+ * @param OpenAPI\Server\Model\Tag[]|null $tags
+ *
+ * @return $this
+ */
+ public function setTags(array $tags = null)
+ {
+ $this->tags = $tags;
+
+ return $this;
+ }
+
+ /**
+ * Gets status.
+ *
+ * @return string|null
+ */
+ public function getStatus()
+ {
+ return $this->status;
+ }
+
+ /**
+ * Sets status.
+ *
+ * @param string|null $status pet status in the store
+ *
+ * @return $this
+ */
+ public function setStatus($status = null)
+ {
+ $this->status = $status;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ReadOnlyFirst.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ReadOnlyFirst.php
new file mode 100644
index 000000000000..7d9288452e3b
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/ReadOnlyFirst.php
@@ -0,0 +1,119 @@
+bar = isset($data['bar']) ? $data['bar'] : null;
+ $this->baz = isset($data['baz']) ? $data['baz'] : null;
+ }
+
+ /**
+ * Gets bar.
+ *
+ * @return string|null
+ */
+ public function getBar()
+ {
+ return $this->bar;
+ }
+
+ /**
+ * Sets bar.
+ *
+ * @param string|null $bar
+ *
+ * @return $this
+ */
+ public function setBar($bar = null)
+ {
+ $this->bar = $bar;
+
+ return $this;
+ }
+
+ /**
+ * Gets baz.
+ *
+ * @return string|null
+ */
+ public function getBaz()
+ {
+ return $this->baz;
+ }
+
+ /**
+ * Sets baz.
+ *
+ * @param string|null $baz
+ *
+ * @return $this
+ */
+ public function setBaz($baz = null)
+ {
+ $this->baz = $baz;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/SpecialModelName.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/SpecialModelName.php
new file mode 100644
index 000000000000..48a2f77824ac
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/SpecialModelName.php
@@ -0,0 +1,86 @@
+specialPropertyName = isset($data['specialPropertyName']) ? $data['specialPropertyName'] : null;
+ }
+
+ /**
+ * Gets specialPropertyName.
+ *
+ * @return int|null
+ */
+ public function getSpecialPropertyName()
+ {
+ return $this->specialPropertyName;
+ }
+
+ /**
+ * Sets specialPropertyName.
+ *
+ * @param int|null $specialPropertyName
+ *
+ * @return $this
+ */
+ public function setSpecialPropertyName($specialPropertyName = null)
+ {
+ $this->specialPropertyName = $specialPropertyName;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Tag.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Tag.php
new file mode 100644
index 000000000000..24203d9011b6
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/Tag.php
@@ -0,0 +1,119 @@
+id = isset($data['id']) ? $data['id'] : null;
+ $this->name = isset($data['name']) ? $data['name'] : null;
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return int|null
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets id.
+ *
+ * @param int|null $id
+ *
+ * @return $this
+ */
+ public function setId($id = null)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets name.
+ *
+ * @return string|null
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets name.
+ *
+ * @param string|null $name
+ *
+ * @return $this
+ */
+ public function setName($name = null)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/User.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/User.php
new file mode 100644
index 000000000000..e6c38be547f6
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Model/User.php
@@ -0,0 +1,319 @@
+id = isset($data['id']) ? $data['id'] : null;
+ $this->username = isset($data['username']) ? $data['username'] : null;
+ $this->firstName = isset($data['firstName']) ? $data['firstName'] : null;
+ $this->lastName = isset($data['lastName']) ? $data['lastName'] : null;
+ $this->email = isset($data['email']) ? $data['email'] : null;
+ $this->password = isset($data['password']) ? $data['password'] : null;
+ $this->phone = isset($data['phone']) ? $data['phone'] : null;
+ $this->userStatus = isset($data['userStatus']) ? $data['userStatus'] : null;
+ }
+
+ /**
+ * Gets id.
+ *
+ * @return int|null
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Sets id.
+ *
+ * @param int|null $id
+ *
+ * @return $this
+ */
+ public function setId($id = null)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets username.
+ *
+ * @return string|null
+ */
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ /**
+ * Sets username.
+ *
+ * @param string|null $username
+ *
+ * @return $this
+ */
+ public function setUsername($username = null)
+ {
+ $this->username = $username;
+
+ return $this;
+ }
+
+ /**
+ * Gets firstName.
+ *
+ * @return string|null
+ */
+ public function getFirstName()
+ {
+ return $this->firstName;
+ }
+
+ /**
+ * Sets firstName.
+ *
+ * @param string|null $firstName
+ *
+ * @return $this
+ */
+ public function setFirstName($firstName = null)
+ {
+ $this->firstName = $firstName;
+
+ return $this;
+ }
+
+ /**
+ * Gets lastName.
+ *
+ * @return string|null
+ */
+ public function getLastName()
+ {
+ return $this->lastName;
+ }
+
+ /**
+ * Sets lastName.
+ *
+ * @param string|null $lastName
+ *
+ * @return $this
+ */
+ public function setLastName($lastName = null)
+ {
+ $this->lastName = $lastName;
+
+ return $this;
+ }
+
+ /**
+ * Gets email.
+ *
+ * @return string|null
+ */
+ public function getEmail()
+ {
+ return $this->email;
+ }
+
+ /**
+ * Sets email.
+ *
+ * @param string|null $email
+ *
+ * @return $this
+ */
+ public function setEmail($email = null)
+ {
+ $this->email = $email;
+
+ return $this;
+ }
+
+ /**
+ * Gets password.
+ *
+ * @return string|null
+ */
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ /**
+ * Sets password.
+ *
+ * @param string|null $password
+ *
+ * @return $this
+ */
+ public function setPassword($password = null)
+ {
+ $this->password = $password;
+
+ return $this;
+ }
+
+ /**
+ * Gets phone.
+ *
+ * @return string|null
+ */
+ public function getPhone()
+ {
+ return $this->phone;
+ }
+
+ /**
+ * Sets phone.
+ *
+ * @param string|null $phone
+ *
+ * @return $this
+ */
+ public function setPhone($phone = null)
+ {
+ $this->phone = $phone;
+
+ return $this;
+ }
+
+ /**
+ * Gets userStatus.
+ *
+ * @return int|null
+ */
+ public function getUserStatus()
+ {
+ return $this->userStatus;
+ }
+
+ /**
+ * Sets userStatus.
+ *
+ * @param int|null $userStatus User Status
+ *
+ * @return $this
+ */
+ public function setUserStatus($userStatus = null)
+ {
+ $this->userStatus = $userStatus;
+
+ return $this;
+ }
+}
+
+
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Resources/docs/Api/AnotherFakeApiInterface.md b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Resources/docs/Api/AnotherFakeApiInterface.md
new file mode 100644
index 000000000000..0152581a38a4
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Resources/docs/Api/AnotherFakeApiInterface.md
@@ -0,0 +1,75 @@
+# OpenAPI\Server\Api\AnotherFakeApiInterface
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call123TestSpecialTags**](AnotherFakeApiInterface.md#call123TestSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+## Service Declaration
+```yaml
+# src/Acme/MyBundle/Resources/services.yml
+services:
+ # ...
+ acme.my_bundle.api.anotherFake:
+ class: Acme\MyBundle\Api\AnotherFakeApi
+ tags:
+ - { name: "open_api_server.api", api: "anotherFake" }
+ # ...
+```
+
+## **call123TestSpecialTags**
+> OpenAPI\Server\Model\Client call123TestSpecialTags($client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\InlineResponseDefault fooGet()
+
+
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\HealthCheckResult fakeHealthGet()
+
+Health check endpoint
+
+### Example Implementation
+```php
+ fakeHttpSignatureTest($pet, $query1, $header1)
+
+test http signature authentication
+
+### Example Implementation
+```php
+ bool fakeOuterBooleanSerialize($body)
+
+
+
+Test serialization of outer boolean types
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\OuterComposite fakeOuterCompositeSerialize($outerComposite)
+
+
+
+Test serialization of object with outer number type
+
+### Example Implementation
+```php
+ float fakeOuterNumberSerialize($body)
+
+
+
+Test serialization of outer number types
+
+### Example Implementation
+```php
+ string fakeOuterStringSerialize($body)
+
+
+
+Test serialization of outer string types
+
+### Example Implementation
+```php
+ testBodyWithFileSchema($fileSchemaTestClass)
+
+
+
+For this test, the body for this request much reference a schema named `File`.
+
+### Example Implementation
+```php
+ testBodyWithQueryParams($query, $user)
+
+
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Client testClientModel($client)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example Implementation
+```php
+ testEndpointParameters($number, $double, $patternWithoutDelimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $dateTime, $password, $callback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example Implementation
+```php
+ testEnumParameters($enumHeaderStringArray, $enumHeaderString, $enumQueryStringArray, $enumQueryString, $enumQueryInteger, $enumQueryDouble, $enumFormStringArray, $enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example Implementation
+```php
+ testGroupParameters($requiredStringGroup, $requiredBooleanGroup, $requiredInt64Group, $stringGroup, $booleanGroup, $int64Group)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example Implementation
+```php
+ testInlineAdditionalProperties($requestBody)
+
+test inline additionalProperties
+
+### Example Implementation
+```php
+ testJsonFormData($param, $param2)
+
+test json serialization of form data
+
+### Example Implementation
+```php
+ testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context)
+
+
+
+To test the collection format in query parameters
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Client testClassname($client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example Implementation
+```php
+ addPet($pet)
+
+Add a new pet to the store
+
+### Example Implementation
+```php
+ deletePet($petId, $apiKey)
+
+Deletes a pet
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Pet findPetsByStatus($status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Pet findPetsByTags($tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Pet getPetById($petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example Implementation
+```php
+ updatePet($pet)
+
+Update an existing pet
+
+### Example Implementation
+```php
+ updatePetWithForm($petId, $name, $status)
+
+Updates a pet in the store with form data
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\ApiResponse uploadFile($petId, $additionalMetadata, $file)
+
+uploads an image
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\ApiResponse uploadFileWithRequiredFile($petId, $requiredFile, $additionalMetadata)
+
+uploads an image (required)
+
+### Example Implementation
+```php
+ deleteOrder($orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example Implementation
+```php
+ int getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Order getOrderById($orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\Order placeOrder($order)
+
+Place an order for a pet
+
+### Example Implementation
+```php
+ createUser($user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example Implementation
+```php
+ createUsersWithArrayInput($user)
+
+Creates list of users with given input array
+
+### Example Implementation
+```php
+ createUsersWithListInput($user)
+
+Creates list of users with given input array
+
+### Example Implementation
+```php
+ deleteUser($username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example Implementation
+```php
+ OpenAPI\Server\Model\User getUserByName($username)
+
+Get user by user name
+
+### Example Implementation
+```php
+ string loginUser($username, $password)
+
+Logs user into the system
+
+### Example Implementation
+```php
+ logoutUser()
+
+Logs out current logged in user session
+
+### Example Implementation
+```php
+ updateUser($username, $user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example Implementation
+```php
+request('PATCH', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/DefaultApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/DefaultApiInterfaceTest.php
new file mode 100644
index 000000000000..5fbfcdb4d185
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/DefaultApiInterfaceTest.php
@@ -0,0 +1,100 @@
+request('GET', $path);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeApiInterfaceTest.php
new file mode 100644
index 000000000000..8d88981ec25e
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeApiInterfaceTest.php
@@ -0,0 +1,310 @@
+request('GET', $path);
+ }
+
+ /**
+ * Test case for fakeHttpSignatureTest
+ *
+ * test http signature authentication.
+ *
+ */
+ public function testFakeHttpSignatureTest()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/http-signature-test';
+
+ $crawler = $client->request('GET', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for fakeOuterBooleanSerialize
+ *
+ * .
+ *
+ */
+ public function testFakeOuterBooleanSerialize()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/outer/boolean';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for fakeOuterCompositeSerialize
+ *
+ * .
+ *
+ */
+ public function testFakeOuterCompositeSerialize()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/outer/composite';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for fakeOuterNumberSerialize
+ *
+ * .
+ *
+ */
+ public function testFakeOuterNumberSerialize()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/outer/number';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for fakeOuterStringSerialize
+ *
+ * .
+ *
+ */
+ public function testFakeOuterStringSerialize()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/outer/string';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for testBodyWithFileSchema
+ *
+ * .
+ *
+ */
+ public function testTestBodyWithFileSchema()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/body-with-file-schema';
+
+ $crawler = $client->request('PUT', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for testBodyWithQueryParams
+ *
+ * .
+ *
+ */
+ public function testTestBodyWithQueryParams()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/body-with-query-params';
+
+ $crawler = $client->request('PUT', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for testClientModel
+ *
+ * To test \"client\" model.
+ *
+ */
+ public function testTestClientModel()
+ {
+ $client = static::createClient();
+
+ $path = '/fake';
+
+ $crawler = $client->request('PATCH', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for testEndpointParameters
+ *
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
+ *
+ */
+ public function testTestEndpointParameters()
+ {
+ $client = static::createClient();
+
+ $path = '/fake';
+
+ $crawler = $client->request('POST', $path);
+ }
+
+ /**
+ * Test case for testEnumParameters
+ *
+ * To test enum parameters.
+ *
+ */
+ public function testTestEnumParameters()
+ {
+ $client = static::createClient();
+
+ $path = '/fake';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for testGroupParameters
+ *
+ * Fake endpoint to test group parameters (optional).
+ *
+ */
+ public function testTestGroupParameters()
+ {
+ $client = static::createClient();
+
+ $path = '/fake';
+
+ $crawler = $client->request('DELETE', $path);
+ }
+
+ /**
+ * Test case for testInlineAdditionalProperties
+ *
+ * test inline additionalProperties.
+ *
+ */
+ public function testTestInlineAdditionalProperties()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/inline-additionalProperties';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for testJsonFormData
+ *
+ * test json serialization of form data.
+ *
+ */
+ public function testTestJsonFormData()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/jsonFormData';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for testQueryParameterCollectionFormat
+ *
+ * .
+ *
+ */
+ public function testTestQueryParameterCollectionFormat()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/test-query-paramters';
+
+ $crawler = $client->request('PUT', $path);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeClassnameTags123ApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeClassnameTags123ApiInterfaceTest.php
new file mode 100644
index 000000000000..9b686face341
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/FakeClassnameTags123ApiInterfaceTest.php
@@ -0,0 +1,100 @@
+request('PATCH', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php
new file mode 100644
index 000000000000..8cc9228b1c5a
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php
@@ -0,0 +1,235 @@
+request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for deletePet
+ *
+ * Deletes a pet.
+ *
+ */
+ public function testDeletePet()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/{petId}';
+ $pattern = '{petId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('DELETE', $path);
+ }
+
+ /**
+ * Test case for findPetsByStatus
+ *
+ * Finds Pets by status.
+ *
+ */
+ public function testFindPetsByStatus()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/findByStatus';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for findPetsByTags
+ *
+ * Finds Pets by tags.
+ *
+ */
+ public function testFindPetsByTags()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/findByTags';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for getPetById
+ *
+ * Find pet by ID.
+ *
+ */
+ public function testGetPetById()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/{petId}';
+ $pattern = '{petId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for updatePet
+ *
+ * Update an existing pet.
+ *
+ */
+ public function testUpdatePet()
+ {
+ $client = static::createClient();
+
+ $path = '/pet';
+
+ $crawler = $client->request('PUT', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for updatePetWithForm
+ *
+ * Updates a pet in the store with form data.
+ *
+ */
+ public function testUpdatePetWithForm()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/{petId}';
+ $pattern = '{petId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('POST', $path);
+ }
+
+ /**
+ * Test case for uploadFile
+ *
+ * uploads an image.
+ *
+ */
+ public function testUploadFile()
+ {
+ $client = static::createClient();
+
+ $path = '/pet/{petId}/uploadImage';
+ $pattern = '{petId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('POST', $path);
+ }
+
+ /**
+ * Test case for uploadFileWithRequiredFile
+ *
+ * uploads an image (required).
+ *
+ */
+ public function testUploadFileWithRequiredFile()
+ {
+ $client = static::createClient();
+
+ $path = '/fake/{petId}/uploadImageWithRequiredFile';
+ $pattern = '{petId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('POST', $path);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php
new file mode 100644
index 000000000000..8e4fe3196838
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php
@@ -0,0 +1,151 @@
+genTestData('[a-z0-9]+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('DELETE', $path);
+ }
+
+ /**
+ * Test case for getInventory
+ *
+ * Returns pet inventories by status.
+ *
+ */
+ public function testGetInventory()
+ {
+ $client = static::createClient();
+
+ $path = '/store/inventory';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for getOrderById
+ *
+ * Find purchase order by ID.
+ *
+ */
+ public function testGetOrderById()
+ {
+ $client = static::createClient();
+
+ $path = '/store/order/{order_id}';
+ $pattern = '{orderId}';
+ $data = $this->genTestData('\d+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for placeOrder
+ *
+ * Place an order for a pet.
+ *
+ */
+ public function testPlaceOrder()
+ {
+ $client = static::createClient();
+
+ $path = '/store/order';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php
new file mode 100644
index 000000000000..5143a215ce88
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php
@@ -0,0 +1,214 @@
+request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for createUsersWithArrayInput
+ *
+ * Creates list of users with given input array.
+ *
+ */
+ public function testCreateUsersWithArrayInput()
+ {
+ $client = static::createClient();
+
+ $path = '/user/createWithArray';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for createUsersWithListInput
+ *
+ * Creates list of users with given input array.
+ *
+ */
+ public function testCreateUsersWithListInput()
+ {
+ $client = static::createClient();
+
+ $path = '/user/createWithList';
+
+ $crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ /**
+ * Test case for deleteUser
+ *
+ * Delete user.
+ *
+ */
+ public function testDeleteUser()
+ {
+ $client = static::createClient();
+
+ $path = '/user/{username}';
+ $pattern = '{username}';
+ $data = $this->genTestData('[a-z0-9]+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('DELETE', $path);
+ }
+
+ /**
+ * Test case for getUserByName
+ *
+ * Get user by user name.
+ *
+ */
+ public function testGetUserByName()
+ {
+ $client = static::createClient();
+
+ $path = '/user/{username}';
+ $pattern = '{username}';
+ $data = $this->genTestData('[a-z0-9]+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for loginUser
+ *
+ * Logs user into the system.
+ *
+ */
+ public function testLoginUser()
+ {
+ $client = static::createClient();
+
+ $path = '/user/login';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for logoutUser
+ *
+ * Logs out current logged in user session.
+ *
+ */
+ public function testLogoutUser()
+ {
+ $client = static::createClient();
+
+ $path = '/user/logout';
+
+ $crawler = $client->request('GET', $path);
+ }
+
+ /**
+ * Test case for updateUser
+ *
+ * Updated user.
+ *
+ */
+ public function testUpdateUser()
+ {
+ $client = static::createClient();
+
+ $path = '/user/{username}';
+ $pattern = '{username}';
+ $data = $this->genTestData('[a-z0-9]+');
+ $path = str_replace($pattern, $data, $path);
+
+ $crawler = $client->request('PUT', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
+ }
+
+ protected function genTestData($regexp)
+ {
+ $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
+ $compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
+ $ast = $compiler->parse($regexp);
+ $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
+
+ return $generator->visit($ast);
+ }
+}
diff --git a/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Model/AdditionalPropertiesClassTest.php b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Model/AdditionalPropertiesClassTest.php
new file mode 100644
index 000000000000..424d2aaad362
--- /dev/null
+++ b/samples/server/petstore/php-symfony5/SymfonyBundle-php/Tests/Model/AdditionalPropertiesClassTest.php
@@ -0,0 +1,96 @@
+