forked from loafle/openapi-generator-original
[php-symfony] Symfony6 support (#11810)
* support symfony6 * fix issues with StrictJsonDeserialization * regenerate samples * add suggestions * update samples * support php 7.4 and symfony 5 * allow versions based on semantic versioning * regenerate sample * change method of determining result types * update samples * describe usage of bundle in symfony app * better documentation * fix duplicate auth methods * do not set namespace for default types * fix UploadedFile type * next try fixing auth * regenerate samples * fix: auth method shall not be duplicated * Revert "fix duplicate auth methods" This reverts commit 0dc418737b1379a30b7f22e7937819ba965c9ddb. * chore: regenerate samples * fix tests * regenerate sample * more fixes for tests * update tests * add kernel shutdown Co-authored-by: Benjamin Haeublein <benjaminh@testing-vm.lan.benjaminh.de> Co-authored-by: Renaud de Chivré <renaud@tahitiwebdesign.com>
This commit is contained in:
parent
96dd6c5806
commit
77fa028bb3
@ -348,6 +348,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
|||||||
supportingFiles.add(new SupportingFile("serialization/SerializerInterface.mustache", toSrcPath(servicePackage, srcBasePath), "SerializerInterface.php"));
|
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/JmsSerializer.mustache", toSrcPath(servicePackage, srcBasePath), "JmsSerializer.php"));
|
||||||
supportingFiles.add(new SupportingFile("serialization/StrictJsonDeserializationVisitor.mustache", toSrcPath(servicePackage, srcBasePath), "StrictJsonDeserializationVisitor.php"));
|
supportingFiles.add(new SupportingFile("serialization/StrictJsonDeserializationVisitor.mustache", toSrcPath(servicePackage, srcBasePath), "StrictJsonDeserializationVisitor.php"));
|
||||||
|
supportingFiles.add(new SupportingFile("serialization/StrictJsonDeserializationVisitorFactory.mustache", toSrcPath(servicePackage, srcBasePath), "StrictJsonDeserializationVisitorFactory.php"));
|
||||||
supportingFiles.add(new SupportingFile("serialization/TypeMismatchException.mustache", toSrcPath(servicePackage, srcBasePath), "TypeMismatchException.php"));
|
supportingFiles.add(new SupportingFile("serialization/TypeMismatchException.mustache", toSrcPath(servicePackage, srcBasePath), "TypeMismatchException.php"));
|
||||||
// Validation components
|
// Validation components
|
||||||
supportingFiles.add(new SupportingFile("validation/ValidatorInterface.mustache", toSrcPath(servicePackage, srcBasePath), "ValidatorInterface.php"));
|
supportingFiles.add(new SupportingFile("validation/ValidatorInterface.mustache", toSrcPath(servicePackage, srcBasePath), "ValidatorInterface.php"));
|
||||||
@ -434,11 +435,26 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg
|
|||||||
} else {
|
} else {
|
||||||
op.vendorExtensions.put("x-comment-type", "void");
|
op.vendorExtensions.put("x-comment-type", "void");
|
||||||
}
|
}
|
||||||
|
// Create a variable to add typing for return value of interface
|
||||||
|
if (op.returnType != null) {
|
||||||
|
if ("array".equals(op.returnContainer)) {
|
||||||
|
op.vendorExtensions.put("x-return-type", "iterable");
|
||||||
|
} else {
|
||||||
|
if (defaultIncludes.contains(op.returnType)) {
|
||||||
|
op.vendorExtensions.put("x-return-type", "array|" + op.returnType);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
op.vendorExtensions.put("x-return-type", "array|\\" + op.returnType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
op.vendorExtensions.put("x-return-type", "void");
|
||||||
|
}
|
||||||
|
|
||||||
// Add operation's authentication methods to whole interface
|
// Add operation's authentication methods to whole interface
|
||||||
if (op.authMethods != null) {
|
if (op.authMethods != null) {
|
||||||
for (CodegenSecurity am : op.authMethods) {
|
for (CodegenSecurity am : op.authMethods) {
|
||||||
if (!authMethods.contains(am)) {
|
if (authMethods.stream().noneMatch(m -> Objects.equals(m.name, am.name))) {
|
||||||
authMethods.add(am);
|
authMethods.add(am);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
language: php
|
language: php
|
||||||
dist: trusty
|
dist: trusty
|
||||||
php:
|
php:
|
||||||
- 7.1.3
|
- 8.1.1
|
||||||
- 7.2
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- composer install --dev --no-interaction
|
- composer install --dev --no-interaction
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* {{bundleName}}ApiPass
|
* {{bundleName}}ApiPass
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{invokerPackage}}\DependencyInjection\Compiler
|
* @package {{invokerPackage}}\DependencyInjection\Compiler
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ApiServer
|
* ApiServer
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{apiPackage}}
|
* @package {{apiPackage}}
|
||||||
@ -22,7 +22,7 @@ namespace {{apiPackage}};
|
|||||||
/**
|
/**
|
||||||
* ApiServer Class Doc Comment
|
* ApiServer Class Doc Comment
|
||||||
*
|
*
|
||||||
* PHP version 5
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{apiPackage}}
|
* @package {{apiPackage}}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* {{bundleClassName}}
|
* {{bundleClassName}}
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{invokerPackage}}
|
* @package {{invokerPackage}}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Controller
|
* Controller
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{controllerPackage}}
|
* @package {{controllerPackage}}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* {{bundleExtensionName}}
|
* {{bundleExtensionName}}
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{invokerPackage}}\DependencyInjection
|
* @package {{invokerPackage}}\DependencyInjection
|
||||||
@ -40,7 +40,7 @@ class {{bundleExtensionName}} extends Extension
|
|||||||
$loader->load('services.yml');
|
$loader->load('services.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAlias()
|
public function getAlias(): string
|
||||||
{
|
{
|
||||||
return '{{bundleAlias}}';
|
return '{{bundleAlias}}';
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
PHP 7.1.3 and later
|
PHP 8.0 and later
|
||||||
|
|
||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
|
|
||||||
@ -56,26 +56,20 @@ composer install
|
|||||||
|
|
||||||
Step 1: Please follow the [installation procedure](#installation--usage) first.
|
Step 1: Please follow the [installation procedure](#installation--usage) first.
|
||||||
|
|
||||||
Step 2: Enable the bundle in the kernel:
|
Step 2: Enable the bundle in the bundle configuration:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<?php
|
// app/config/bundles.php
|
||||||
// app/AppKernel.php
|
return [
|
||||||
|
// ...
|
||||||
public function registerBundles()
|
{{invokerPackage}}\{{bundleClassName}}::class => ['all' => true],
|
||||||
{
|
];
|
||||||
$bundles = array(
|
|
||||||
// ...
|
|
||||||
new {{invokerPackage}}\{{bundleClassName}}(),
|
|
||||||
// ...
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 3: Register the routes:
|
Step 3: Register the routes:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# app/config/routing.yml
|
# app/config/routes.yaml
|
||||||
{{bundleAlias}}:
|
{{bundleAlias}}:
|
||||||
resource: "@{{bundleName}}Bundle/Resources/config/routing.yml"
|
resource: "@{{bundleName}}Bundle/Resources/config/routing.yml"
|
||||||
```
|
```
|
||||||
@ -112,7 +106,7 @@ class {{baseName}}Api implements {{classname}} // An interface is autogenerated
|
|||||||
/**
|
/**
|
||||||
* Implementation of {{classname}}#{{operationId}}
|
* Implementation of {{classname}}#{{operationId}}
|
||||||
*/
|
*/
|
||||||
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
|
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}, &$responseCode, array &$responseHeaders): {{#isArray}}iterable{{/isArray}}{{^isArray}}array|{{{vendorExtensions.x-comment-type}}}{{/isArray}}
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -125,11 +119,10 @@ class {{baseName}}Api implements {{classname}} // An interface is autogenerated
|
|||||||
Step 5: Tag your API implementation:
|
Step 5: Tag your API implementation:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.{{pathPrefix}}:
|
Acme\MyBundle\Api\{{baseName}}Api:
|
||||||
class: Acme\MyBundle\Api\{{baseName}}Api
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "{{bundleAlias}}.api", api: "{{pathPrefix}}" }
|
- { name: "{{bundleAlias}}.api", api: "{{pathPrefix}}" }
|
||||||
# ...
|
# ...
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* {{classname}}
|
* {{classname}}
|
||||||
* PHP version 7.1.3
|
*
|
||||||
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{invokerPackage}}
|
* @package {{invokerPackage}}
|
||||||
@ -59,7 +60,6 @@ interface {{classname}}
|
|||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
* @param {{vendorExtensions.x-comment-type}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
|
* @param {{vendorExtensions.x-comment-type}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return {{{vendorExtensions.x-comment-type}}}
|
* @return {{{vendorExtensions.x-comment-type}}}
|
||||||
@ -67,7 +67,8 @@ interface {{classname}}
|
|||||||
* @deprecated
|
* @deprecated
|
||||||
{{/isDeprecated}}
|
{{/isDeprecated}}
|
||||||
*/
|
*/
|
||||||
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}&$responseCode, array &$responseHeaders);
|
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}&$responseCode, array &$responseHeaders): {{{vendorExtensions.x-return-type}}};
|
||||||
|
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
}
|
}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{{#operations}}/**
|
{{#operations}}/**
|
||||||
* {{controllerName}}
|
* {{controllerName}}
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{controllerPackage}}
|
* @package {{controllerPackage}}
|
||||||
|
@ -11,11 +11,10 @@ Method | HTTP request | Description
|
|||||||
{{#operations}}
|
{{#operations}}
|
||||||
## Service Declaration
|
## Service Declaration
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.{{pathPrefix}}:
|
Acme\MyBundle\Api\{{baseName}}Api:
|
||||||
class: Acme\MyBundle\Api\{{baseName}}Api
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "{{bundleAlias}}.api", api: "{{pathPrefix}}" }
|
- { name: "{{bundleAlias}}.api", api: "{{pathPrefix}}" }
|
||||||
# ...
|
# ...
|
||||||
@ -62,7 +61,7 @@ class {{baseName}}Api implements {{classname}}
|
|||||||
/**
|
/**
|
||||||
* Implementation of {{classname}}#{{operationId}}
|
* Implementation of {{classname}}#{{operationId}}
|
||||||
*/
|
*/
|
||||||
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}})
|
public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}, &$responseCode, array &$responseHeaders): {{{vendorExtensions.x-return-type}}}
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
|
@ -19,22 +19,24 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1.3",
|
"php": ">=7.4.0|>=8.0.2",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"symfony/validator": "*",
|
"symfony/validator": "^5.0|^6.0",
|
||||||
"jms/serializer-bundle": "^2.0",
|
"jms/serializer-bundle": "^4.0",
|
||||||
"symfony/framework-bundle": "^4.4.8"
|
"symfony/framework-bundle": "^5.0|^6.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^9.5",
|
||||||
"friendsofphp/php-cs-fixer": "^2.16.3",
|
"friendsofphp/php-cs-fixer": "^2.16.3",
|
||||||
"symfony/browser-kit": "*",
|
"symfony/browser-kit": "^5.0|^6.0",
|
||||||
"symfony/yaml": "^4.4.8",
|
"symfony/yaml": "^5.0|^6.0",
|
||||||
"hoa/regex": "~1.0"
|
"hoa/regex": "~1.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" }
|
"psr-4": {
|
||||||
|
"{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
/**
|
/**
|
||||||
* {{classname}}
|
* {{classname}}
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{modelPackage}}
|
* @package {{modelPackage}}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
path: {{path}}
|
path: {{path}}
|
||||||
methods: [{{httpMethod}}]
|
methods: [{{httpMethod}}]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: {{bundleAlias}}.controller.{{pathPrefix}}:{{operationId}}Action
|
_controller: {{bundleAlias}}.controller.{{pathPrefix}}::{{operationId}}Action
|
||||||
{{#hasPathParams}}
|
{{#hasPathParams}}
|
||||||
requirements:
|
requirements:
|
||||||
{{/hasPathParams}}
|
{{/hasPathParams}}
|
||||||
|
@ -5,7 +5,9 @@ namespace {{servicePackage}};
|
|||||||
use JMS\Serializer\SerializerBuilder;
|
use JMS\Serializer\SerializerBuilder;
|
||||||
use JMS\Serializer\Naming\CamelCaseNamingStrategy;
|
use JMS\Serializer\Naming\CamelCaseNamingStrategy;
|
||||||
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
|
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
|
||||||
use JMS\Serializer\XmlDeserializationVisitor;
|
use JMS\Serializer\Visitor\Factory\XmlDeserializationVisitorFactory;
|
||||||
|
use DateTime;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
class JmsSerializer implements SerializerInterface
|
class JmsSerializer implements SerializerInterface
|
||||||
{
|
{
|
||||||
@ -13,10 +15,11 @@ class JmsSerializer implements SerializerInterface
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$naming_strategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
|
$namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
|
||||||
$this->serializer = SerializerBuilder::create()
|
$this->serializer = SerializerBuilder::create()
|
||||||
->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy))
|
->setDeserializationVisitor('json', new StrictJsonDeserializationVisitorFactory())
|
||||||
->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy))
|
->setDeserializationVisitor('xml', new XmlDeserializationVisitorFactory())
|
||||||
|
->setPropertyNamingStrategy($namingStrategy)
|
||||||
->build();
|
->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +82,11 @@ class JmsSerializer implements SerializerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case 'DateTime':
|
||||||
|
case '\DateTime':
|
||||||
|
return new DateTime($data);
|
||||||
|
default:
|
||||||
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we end up here, just return data
|
// If we end up here, just return data
|
||||||
|
@ -15,58 +15,145 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace {{servicePackage}};
|
namespace {{servicePackage}};
|
||||||
|
|
||||||
use JMS\Serializer\Context;
|
|
||||||
use JMS\Serializer\JsonDeserializationVisitor;
|
use JMS\Serializer\JsonDeserializationVisitor;
|
||||||
|
use JMS\Serializer\GraphNavigatorInterface;
|
||||||
|
use JMS\Serializer\Metadata\ClassMetadata;
|
||||||
|
use JMS\Serializer\Metadata\PropertyMetadata;
|
||||||
|
use JMS\Serializer\Visitor\DeserializationVisitorInterface;
|
||||||
|
|
||||||
class StrictJsonDeserializationVisitor extends JsonDeserializationVisitor
|
class StrictJsonDeserializationVisitor implements DeserializationVisitorInterface
|
||||||
{
|
{
|
||||||
|
protected $jsonDeserializationVisitor: JsonDeserializationVisitor;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
int $options = 0,
|
||||||
|
int $depth = 512
|
||||||
|
) {
|
||||||
|
$this->jsonDeserializationVisitor = new JsonDeserializationVisitor($options, $depth);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitString($data, array $type, Context $context)
|
public function visitNull($data, array $type)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitNull($data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitString($data, array $type): string
|
||||||
{
|
{
|
||||||
if (!is_string($data)) {
|
if (!is_string($data)) {
|
||||||
throw TypeMismatchException::fromValue('string', $data, $context);
|
throw TypeMismatchException::fromValue('string', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitString($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitString($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitBoolean($data, array $type, Context $context)
|
public function visitBoolean($data, array $type): bool
|
||||||
{
|
{
|
||||||
if (!is_bool($data)) {
|
if (!is_bool($data)) {
|
||||||
throw TypeMismatchException::fromValue('boolean', $data, $context);
|
throw TypeMismatchException::fromValue('boolean', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitBoolean($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitBoolean($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitInteger($data, array $type, Context $context)
|
public function visitInteger($data, array $type): int
|
||||||
{
|
{
|
||||||
if (!is_int($data)) {
|
if (!is_int($data)) {
|
||||||
throw TypeMismatchException::fromValue('integer', $data, $context);
|
throw TypeMismatchException::fromValue('integer', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitInteger($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitInteger($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitDouble($data, array $type, Context $context)
|
public function visitDouble($data, array $type): float
|
||||||
{
|
{
|
||||||
if (!is_float($data) && !is_integer($data)) {
|
if (!is_float($data) && !is_integer($data)) {
|
||||||
throw TypeMismatchException::fromValue('double', $data, $context);
|
throw TypeMismatchException::fromValue('double', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitDouble($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitDouble($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitArray($data, array $type): array
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitArray($data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitDiscriminatorMapProperty($data, ClassMetadata $metadata): string
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitDiscriminatorMapProperty($data, $metadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function startVisitingObject(ClassMetadata $metadata, object $data, array $type): void
|
||||||
|
{
|
||||||
|
$this->jsonDeserializationVisitor->startVisitingObject($metadata, $data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitProperty(PropertyMetadata $metadata, $data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitProperty($metadata, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function endVisitingObject(ClassMetadata $metadata, $data, array $type): object
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->endVisitingObject($metadata, $data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getResult($data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->getResult($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function prepare($data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->prepare($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function setNavigator(GraphNavigatorInterface $navigator): void
|
||||||
|
{
|
||||||
|
$this->jsonDeserializationVisitor->setNavigator($navigator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace {{servicePackage}};
|
||||||
|
|
||||||
|
use JMS\Serializer\Visitor\DeserializationVisitorInterface;
|
||||||
|
use JMS\Serializer\Visitor\Factory\DeserializationVisitorFactory;
|
||||||
|
|
||||||
|
final class StrictJsonDeserializationVisitorFactory implements DeserializationVisitorFactory
|
||||||
|
{
|
||||||
|
private int $options = 0;
|
||||||
|
|
||||||
|
private int $depth = 512;
|
||||||
|
|
||||||
|
public function getVisitor(): DeserializationVisitorInterface
|
||||||
|
{
|
||||||
|
return new StrictJsonDeserializationVisitor($this->options, $this->depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOptions(int $options): self
|
||||||
|
{
|
||||||
|
$this->options = $options;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDepth(int $depth): self
|
||||||
|
{
|
||||||
|
$this->depth = $depth;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -30,8 +30,8 @@ services:
|
|||||||
- [setSerializer, ['@{{bundleAlias}}.service.serializer']]
|
- [setSerializer, ['@{{bundleAlias}}.service.serializer']]
|
||||||
- [setValidator, ['@{{bundleAlias}}.service.validator']]
|
- [setValidator, ['@{{bundleAlias}}.service.validator']]
|
||||||
- [setApiServer, ['@{{bundleAlias}}.api.api_server']]
|
- [setApiServer, ['@{{bundleAlias}}.api.api_server']]
|
||||||
|
- [setContainer, ['@service_container']]
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
autowire: true
|
|
||||||
|
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
{{/apis}}
|
{{/apis}}
|
||||||
|
@ -8,7 +8,7 @@ use Symfony\Component\Config\Loader\LoaderInterface;
|
|||||||
|
|
||||||
class AppKernel extends Kernel
|
class AppKernel extends Kernel
|
||||||
{
|
{
|
||||||
public function registerBundles()
|
public function registerBundles(): iterable
|
||||||
{
|
{
|
||||||
$bundles = array(
|
$bundles = array(
|
||||||
new FrameworkBundle()
|
new FrameworkBundle()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ControllerTest
|
* ControllerTest
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{controllerTestsPackage}}
|
* @package {{controllerTestsPackage}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* {{classname}}Test
|
* {{classname}}Test
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{apiTestsPackage}}
|
* @package {{apiTestsPackage}}
|
||||||
@ -22,6 +22,7 @@ use {{invokerPackage}}\Configuration;
|
|||||||
use {{invokerPackage}}\ApiClient;
|
use {{invokerPackage}}\ApiClient;
|
||||||
use {{invokerPackage}}\ApiException;
|
use {{invokerPackage}}\ApiException;
|
||||||
use {{invokerPackage}}\ObjectSerializer;
|
use {{invokerPackage}}\ObjectSerializer;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,32 +35,37 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
{{#operations}}class {{classname}}Test extends WebTestCase
|
{{#operations}}class {{classname}}Test extends WebTestCase
|
||||||
{
|
{
|
||||||
|
private static ?KernelBrowser $client = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running any test cases
|
* Setup before running any test cases
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
if (null === self::$client) {
|
||||||
|
self::$client = static::createClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
|
static::ensureKernelShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
@ -72,7 +78,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
public function test{{operationIdCamelCase}}()
|
public function test{{operationIdCamelCase}}()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '{{path}}';
|
$path = '{{path}}';
|
||||||
{{#pathParams}}
|
{{#pathParams}}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
/**
|
/**
|
||||||
* {{classname}}Test
|
* {{classname}}Test
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package {{modelTestsPackage}}
|
* @package {{modelTestsPackage}}
|
||||||
@ -39,28 +39,28 @@ class {{classname}}Test extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,4 +5,4 @@ framework:
|
|||||||
secret: "testsecret"
|
secret: "testsecret"
|
||||||
test: ~
|
test: ~
|
||||||
router:
|
router:
|
||||||
resource: "%kernel.root_dir%/../Resources/config/routing.yml"
|
resource: "%kernel.project_dir%/../Resources/config/routing.yml"
|
||||||
|
@ -34,11 +34,21 @@ Resources/docs/Model/User.md
|
|||||||
Service/JmsSerializer.php
|
Service/JmsSerializer.php
|
||||||
Service/SerializerInterface.php
|
Service/SerializerInterface.php
|
||||||
Service/StrictJsonDeserializationVisitor.php
|
Service/StrictJsonDeserializationVisitor.php
|
||||||
|
Service/StrictJsonDeserializationVisitorFactory.php
|
||||||
Service/SymfonyValidator.php
|
Service/SymfonyValidator.php
|
||||||
Service/TypeMismatchException.php
|
Service/TypeMismatchException.php
|
||||||
Service/ValidatorInterface.php
|
Service/ValidatorInterface.php
|
||||||
|
Tests/Api/PetApiInterfaceTest.php
|
||||||
|
Tests/Api/StoreApiInterfaceTest.php
|
||||||
|
Tests/Api/UserApiInterfaceTest.php
|
||||||
Tests/AppKernel.php
|
Tests/AppKernel.php
|
||||||
Tests/Controller/ControllerTest.php
|
Tests/Controller/ControllerTest.php
|
||||||
|
Tests/Model/ApiResponseTest.php
|
||||||
|
Tests/Model/CategoryTest.php
|
||||||
|
Tests/Model/OrderTest.php
|
||||||
|
Tests/Model/PetTest.php
|
||||||
|
Tests/Model/TagTest.php
|
||||||
|
Tests/Model/UserTest.php
|
||||||
Tests/test_config.yml
|
Tests/test_config.yml
|
||||||
autoload.php
|
autoload.php
|
||||||
composer.json
|
composer.json
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
language: php
|
language: php
|
||||||
dist: trusty
|
dist: trusty
|
||||||
php:
|
php:
|
||||||
- 7.1.3
|
- 8.1.1
|
||||||
- 7.2
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- composer install --dev --no-interaction
|
- composer install --dev --no-interaction
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ApiServer
|
* ApiServer
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Api
|
* @package OpenAPI\Server\Api
|
||||||
@ -32,7 +32,7 @@ namespace OpenAPI\Server\Api;
|
|||||||
/**
|
/**
|
||||||
* ApiServer Class Doc Comment
|
* ApiServer Class Doc Comment
|
||||||
*
|
*
|
||||||
* PHP version 5
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Api
|
* @package OpenAPI\Server\Api
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PetApiInterface
|
* PetApiInterface
|
||||||
* PHP version 7.1.3
|
*
|
||||||
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server
|
* @package OpenAPI\Server
|
||||||
@ -52,15 +53,6 @@ interface PetApiInterface
|
|||||||
*/
|
*/
|
||||||
public function setpetstore_auth($value);
|
public function setpetstore_auth($value);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets authentication method petstore_auth
|
|
||||||
*
|
|
||||||
* @param string $value Value of the petstore_auth authentication method.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setpetstore_auth($value);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets authentication method api_key
|
* Sets authentication method api_key
|
||||||
*
|
*
|
||||||
@ -76,12 +68,12 @@ interface PetApiInterface
|
|||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
|
* @param \OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Pet
|
* @return \OpenAPI\Server\Model\Pet
|
||||||
*/
|
*/
|
||||||
public function addPet(Pet $pet, &$responseCode, array &$responseHeaders);
|
public function addPet(Pet $pet, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation deletePet
|
* Operation deletePet
|
||||||
@ -90,12 +82,12 @@ interface PetApiInterface
|
|||||||
*
|
*
|
||||||
* @param \int $petId Pet id to delete (required)
|
* @param \int $petId Pet id to delete (required)
|
||||||
* @param \string $apiKey (optional)
|
* @param \string $apiKey (optional)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function deletePet($petId, $apiKey = null, &$responseCode, array &$responseHeaders);
|
public function deletePet($petId, $apiKey = null, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation findPetsByStatus
|
* Operation findPetsByStatus
|
||||||
@ -103,12 +95,12 @@ interface PetApiInterface
|
|||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
*
|
*
|
||||||
* @param \string[] $status Status values that need to be considered for filter (required) (deprecated)
|
* @param \string[] $status Status values that need to be considered for filter (required) (deprecated)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Pet[]
|
* @return \OpenAPI\Server\Model\Pet[]
|
||||||
*/
|
*/
|
||||||
public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders);
|
public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders): iterable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation findPetsByTags
|
* Operation findPetsByTags
|
||||||
@ -116,13 +108,13 @@ interface PetApiInterface
|
|||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
*
|
*
|
||||||
* @param \string[] $tags Tags to filter by (required)
|
* @param \string[] $tags Tags to filter by (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Pet[]
|
* @return \OpenAPI\Server\Model\Pet[]
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function findPetsByTags(array $tags, &$responseCode, array &$responseHeaders);
|
public function findPetsByTags(array $tags, &$responseCode, array &$responseHeaders): iterable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation getPetById
|
* Operation getPetById
|
||||||
@ -130,12 +122,12 @@ interface PetApiInterface
|
|||||||
* Find pet by ID
|
* Find pet by ID
|
||||||
*
|
*
|
||||||
* @param \int $petId ID of pet to return (required)
|
* @param \int $petId ID of pet to return (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Pet
|
* @return \OpenAPI\Server\Model\Pet
|
||||||
*/
|
*/
|
||||||
public function getPetById($petId, &$responseCode, array &$responseHeaders);
|
public function getPetById($petId, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation updatePet
|
* Operation updatePet
|
||||||
@ -143,12 +135,12 @@ interface PetApiInterface
|
|||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
|
* @param \OpenAPI\Server\Model\Pet $pet Pet object that needs to be added to the store (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Pet
|
* @return \OpenAPI\Server\Model\Pet
|
||||||
*/
|
*/
|
||||||
public function updatePet(Pet $pet, &$responseCode, array &$responseHeaders);
|
public function updatePet(Pet $pet, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation updatePetWithForm
|
* Operation updatePetWithForm
|
||||||
@ -158,12 +150,12 @@ interface PetApiInterface
|
|||||||
* @param \int $petId ID of pet that needs to be updated (required)
|
* @param \int $petId ID of pet that needs to be updated (required)
|
||||||
* @param \string $name Updated name of the pet (optional)
|
* @param \string $name Updated name of the pet (optional)
|
||||||
* @param \string $status Updated status of the pet (optional)
|
* @param \string $status Updated status of the pet (optional)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function updatePetWithForm($petId, $name = null, $status = null, &$responseCode, array &$responseHeaders);
|
public function updatePetWithForm($petId, $name = null, $status = null, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation uploadFile
|
* Operation uploadFile
|
||||||
@ -173,10 +165,10 @@ interface PetApiInterface
|
|||||||
* @param \int $petId ID of pet to update (required)
|
* @param \int $petId ID of pet to update (required)
|
||||||
* @param \string $additionalMetadata Additional data to pass to server (optional)
|
* @param \string $additionalMetadata Additional data to pass to server (optional)
|
||||||
* @param \UploadedFile $file file to upload (optional)
|
* @param \UploadedFile $file file to upload (optional)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\ApiResponse
|
* @return \OpenAPI\Server\Model\ApiResponse
|
||||||
*/
|
*/
|
||||||
public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null, &$responseCode, array &$responseHeaders);
|
public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\ApiResponse;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* StoreApiInterface
|
* StoreApiInterface
|
||||||
* PHP version 7.1.3
|
*
|
||||||
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server
|
* @package OpenAPI\Server
|
||||||
@ -57,24 +58,24 @@ interface StoreApiInterface
|
|||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
*
|
*
|
||||||
* @param \string $orderId ID of the order that needs to be deleted (required)
|
* @param \string $orderId ID of the order that needs to be deleted (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function deleteOrder($orderId, &$responseCode, array &$responseHeaders);
|
public function deleteOrder($orderId, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation getInventory
|
* Operation getInventory
|
||||||
*
|
*
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
*
|
*
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \int
|
* @return \int
|
||||||
*/
|
*/
|
||||||
public function getInventory(&$responseCode, array &$responseHeaders);
|
public function getInventory(&$responseCode, array &$responseHeaders): array|\int;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation getOrderById
|
* Operation getOrderById
|
||||||
@ -82,12 +83,12 @@ interface StoreApiInterface
|
|||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
*
|
*
|
||||||
* @param \int $orderId ID of pet that needs to be fetched (required)
|
* @param \int $orderId ID of pet that needs to be fetched (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Order
|
* @return \OpenAPI\Server\Model\Order
|
||||||
*/
|
*/
|
||||||
public function getOrderById($orderId, &$responseCode, array &$responseHeaders);
|
public function getOrderById($orderId, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Order;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation placeOrder
|
* Operation placeOrder
|
||||||
@ -95,10 +96,10 @@ interface StoreApiInterface
|
|||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\Order $order order placed for purchasing the pet (required)
|
* @param \OpenAPI\Server\Model\Order $order order placed for purchasing the pet (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\Order
|
* @return \OpenAPI\Server\Model\Order
|
||||||
*/
|
*/
|
||||||
public function placeOrder(Order $order, &$responseCode, array &$responseHeaders);
|
public function placeOrder(Order $order, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Order;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* UserApiInterface
|
* UserApiInterface
|
||||||
* PHP version 7.1.3
|
*
|
||||||
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server
|
* @package OpenAPI\Server
|
||||||
@ -57,12 +58,12 @@ interface UserApiInterface
|
|||||||
* Create user
|
* Create user
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\User $user Created user object (required)
|
* @param \OpenAPI\Server\Model\User $user Created user object (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createUser(User $user, &$responseCode, array &$responseHeaders);
|
public function createUser(User $user, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation createUsersWithArrayInput
|
* Operation createUsersWithArrayInput
|
||||||
@ -70,12 +71,12 @@ interface UserApiInterface
|
|||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\User[] $user List of user object (required)
|
* @param \OpenAPI\Server\Model\User[] $user List of user object (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createUsersWithArrayInput(array $user, &$responseCode, array &$responseHeaders);
|
public function createUsersWithArrayInput(array $user, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation createUsersWithListInput
|
* Operation createUsersWithListInput
|
||||||
@ -83,12 +84,12 @@ interface UserApiInterface
|
|||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param \OpenAPI\Server\Model\User[] $user List of user object (required)
|
* @param \OpenAPI\Server\Model\User[] $user List of user object (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createUsersWithListInput(array $user, &$responseCode, array &$responseHeaders);
|
public function createUsersWithListInput(array $user, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation deleteUser
|
* Operation deleteUser
|
||||||
@ -96,12 +97,12 @@ interface UserApiInterface
|
|||||||
* Delete user
|
* Delete user
|
||||||
*
|
*
|
||||||
* @param \string $username The name that needs to be deleted (required)
|
* @param \string $username The name that needs to be deleted (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function deleteUser($username, &$responseCode, array &$responseHeaders);
|
public function deleteUser($username, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation getUserByName
|
* Operation getUserByName
|
||||||
@ -109,12 +110,12 @@ interface UserApiInterface
|
|||||||
* Get user by user name
|
* Get user by user name
|
||||||
*
|
*
|
||||||
* @param \string $username The name that needs to be fetched. Use user1 for testing. (required)
|
* @param \string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \OpenAPI\Server\Model\User
|
* @return \OpenAPI\Server\Model\User
|
||||||
*/
|
*/
|
||||||
public function getUserByName($username, &$responseCode, array &$responseHeaders);
|
public function getUserByName($username, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\User;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation loginUser
|
* Operation loginUser
|
||||||
@ -123,24 +124,24 @@ interface UserApiInterface
|
|||||||
*
|
*
|
||||||
* @param \string $username The user name for login (required)
|
* @param \string $username The user name for login (required)
|
||||||
* @param \string $password The password for login in clear text (required)
|
* @param \string $password The password for login in clear text (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return \string
|
* @return \string
|
||||||
*/
|
*/
|
||||||
public function loginUser($username, $password, &$responseCode, array &$responseHeaders);
|
public function loginUser($username, $password, &$responseCode, array &$responseHeaders): array|\string;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation logoutUser
|
* Operation logoutUser
|
||||||
*
|
*
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
*
|
*
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function logoutUser(&$responseCode, array &$responseHeaders);
|
public function logoutUser(&$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation updateUser
|
* Operation updateUser
|
||||||
@ -149,10 +150,10 @@ interface UserApiInterface
|
|||||||
*
|
*
|
||||||
* @param \string $username name that need to be deleted (required)
|
* @param \string $username name that need to be deleted (required)
|
||||||
* @param \OpenAPI\Server\Model\User $user Updated user object (required)
|
* @param \OpenAPI\Server\Model\User $user Updated user object (required)
|
||||||
* @param \int $responseCode The HTTP response code to return
|
|
||||||
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
* @param \array $responseHeaders Additional HTTP headers to return with the response ()
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function updateUser($username, User $user, &$responseCode, array &$responseHeaders);
|
public function updateUser($username, User $user, &$responseCode, array &$responseHeaders): void;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Controller
|
* Controller
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Controller
|
* @package OpenAPI\Server\Controller
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* PetController
|
* PetController
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Controller
|
* @package OpenAPI\Server\Controller
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* StoreController
|
* StoreController
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Controller
|
* @package OpenAPI\Server\Controller
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UserController
|
* UserController
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Controller
|
* @package OpenAPI\Server\Controller
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPIServerApiPass
|
* OpenAPIServerApiPass
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\DependencyInjection\Compiler
|
* @package OpenAPI\Server\DependencyInjection\Compiler
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPIServerExtension
|
* OpenAPIServerExtension
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\DependencyInjection
|
* @package OpenAPI\Server\DependencyInjection
|
||||||
@ -50,7 +50,7 @@ class OpenAPIServerExtension extends Extension
|
|||||||
$loader->load('services.yml');
|
$loader->load('services.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAlias()
|
public function getAlias(): string
|
||||||
{
|
{
|
||||||
return 'open_api_server';
|
return 'open_api_server';
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ApiResponse
|
* ApiResponse
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Category
|
* Category
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -1,123 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* InlineObject
|
|
||||||
*
|
|
||||||
* PHP version 7.1.3
|
|
||||||
*
|
|
||||||
* @category Class
|
|
||||||
* @package OpenAPI\Server\Model
|
|
||||||
* @author OpenAPI Generator team
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
*
|
|
||||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
||||||
*
|
|
||||||
* The version of the OpenAPI document: 1.0.0
|
|
||||||
*
|
|
||||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE: This class is auto generated by the openapi generator program.
|
|
||||||
* https://github.com/openapitools/openapi-generator
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace OpenAPI\Server\Model;
|
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
|
||||||
use JMS\Serializer\Annotation\Type;
|
|
||||||
use JMS\Serializer\Annotation\SerializedName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class representing the InlineObject model.
|
|
||||||
*
|
|
||||||
* @package OpenAPI\Server\Model
|
|
||||||
* @author OpenAPI Generator team
|
|
||||||
*/
|
|
||||||
class InlineObject
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Updated name of the pet
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
* @SerializedName("name")
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
|
||||||
*/
|
|
||||||
protected $name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updated status of the pet
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
* @SerializedName("status")
|
|
||||||
* @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->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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* InlineObject1
|
|
||||||
*
|
|
||||||
* PHP version 7.1.3
|
|
||||||
*
|
|
||||||
* @category Class
|
|
||||||
* @package OpenAPI\Server\Model
|
|
||||||
* @author OpenAPI Generator team
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
*
|
|
||||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
||||||
*
|
|
||||||
* The version of the OpenAPI document: 1.0.0
|
|
||||||
*
|
|
||||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE: This class is auto generated by the openapi generator program.
|
|
||||||
* https://github.com/openapitools/openapi-generator
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace OpenAPI\Server\Model;
|
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
|
||||||
use JMS\Serializer\Annotation\Type;
|
|
||||||
use JMS\Serializer\Annotation\SerializedName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class representing the InlineObject1 model.
|
|
||||||
*
|
|
||||||
* @package OpenAPI\Server\Model
|
|
||||||
* @author OpenAPI Generator team
|
|
||||||
*/
|
|
||||||
class InlineObject1
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Additional data to pass to server
|
|
||||||
*
|
|
||||||
* @var string|null
|
|
||||||
* @SerializedName("additionalMetadata")
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
|
||||||
*/
|
|
||||||
protected $additionalMetadata;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* file to upload
|
|
||||||
*
|
|
||||||
* @var UploadedFile|null
|
|
||||||
* @SerializedName("file")
|
|
||||||
* @Assert\Type("UploadedFile")
|
|
||||||
* @Type("UploadedFile")
|
|
||||||
*/
|
|
||||||
protected $file;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param mixed[] $data Associated array of property values initializing the model
|
|
||||||
*/
|
|
||||||
public function __construct(array $data = null)
|
|
||||||
{
|
|
||||||
$this->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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Order
|
* Order
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pet
|
* Pet
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Tag
|
* Tag
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Model
|
* @package OpenAPI\Server\Model
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPIServerBundle
|
* OpenAPIServerBundle
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server
|
* @package OpenAPI\Server
|
||||||
|
@ -8,7 +8,7 @@ This [Symfony](https://symfony.com/) bundle is automatically generated by the [O
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
PHP 7.1.3 and later
|
PHP 8.0 and later
|
||||||
|
|
||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
|
|
||||||
@ -45,26 +45,20 @@ composer install
|
|||||||
|
|
||||||
Step 1: Please follow the [installation procedure](#installation--usage) first.
|
Step 1: Please follow the [installation procedure](#installation--usage) first.
|
||||||
|
|
||||||
Step 2: Enable the bundle in the kernel:
|
Step 2: Enable the bundle in the bundle configuration:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<?php
|
// app/config/bundles.php
|
||||||
// app/AppKernel.php
|
return [
|
||||||
|
// ...
|
||||||
public function registerBundles()
|
OpenAPI\Server\OpenAPIServerBundle::class => ['all' => true],
|
||||||
{
|
];
|
||||||
$bundles = array(
|
|
||||||
// ...
|
|
||||||
new OpenAPI\Server\OpenAPIServerBundle(),
|
|
||||||
// ...
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 3: Register the routes:
|
Step 3: Register the routes:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# app/config/routing.yml
|
# app/config/routes.yaml
|
||||||
open_api_server:
|
open_api_server:
|
||||||
resource: "@OpenAPIServerBundle/Resources/config/routing.yml"
|
resource: "@OpenAPIServerBundle/Resources/config/routing.yml"
|
||||||
```
|
```
|
||||||
@ -93,7 +87,7 @@ class PetApi implements PetApiInterface // An interface is autogenerated
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#addPet
|
* Implementation of PetApiInterface#addPet
|
||||||
*/
|
*/
|
||||||
public function addPet(Pet $pet)
|
public function addPet(Pet $pet, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -105,11 +99,10 @@ class PetApi implements PetApiInterface // An interface is autogenerated
|
|||||||
Step 5: Tag your API implementation:
|
Step 5: Tag your API implementation:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.pet:
|
Acme\MyBundle\Api\PetApi:
|
||||||
class: Acme\MyBundle\Api\PetApi
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "open_api_server.api", api: "pet" }
|
- { name: "open_api_server.api", api: "pet" }
|
||||||
# ...
|
# ...
|
||||||
|
@ -7,13 +7,13 @@ open_api_server_pet_addpet:
|
|||||||
path: /pet
|
path: /pet
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:addPetAction
|
_controller: open_api_server.controller.pet::addPetAction
|
||||||
|
|
||||||
open_api_server_pet_deletepet:
|
open_api_server_pet_deletepet:
|
||||||
path: /pet/{petId}
|
path: /pet/{petId}
|
||||||
methods: [DELETE]
|
methods: [DELETE]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:deletePetAction
|
_controller: open_api_server.controller.pet::deletePetAction
|
||||||
requirements:
|
requirements:
|
||||||
petId: '\d+'
|
petId: '\d+'
|
||||||
|
|
||||||
@ -21,19 +21,19 @@ open_api_server_pet_findpetsbystatus:
|
|||||||
path: /pet/findByStatus
|
path: /pet/findByStatus
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:findPetsByStatusAction
|
_controller: open_api_server.controller.pet::findPetsByStatusAction
|
||||||
|
|
||||||
open_api_server_pet_findpetsbytags:
|
open_api_server_pet_findpetsbytags:
|
||||||
path: /pet/findByTags
|
path: /pet/findByTags
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:findPetsByTagsAction
|
_controller: open_api_server.controller.pet::findPetsByTagsAction
|
||||||
|
|
||||||
open_api_server_pet_getpetbyid:
|
open_api_server_pet_getpetbyid:
|
||||||
path: /pet/{petId}
|
path: /pet/{petId}
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:getPetByIdAction
|
_controller: open_api_server.controller.pet::getPetByIdAction
|
||||||
requirements:
|
requirements:
|
||||||
petId: '\d+'
|
petId: '\d+'
|
||||||
|
|
||||||
@ -41,13 +41,13 @@ open_api_server_pet_updatepet:
|
|||||||
path: /pet
|
path: /pet
|
||||||
methods: [PUT]
|
methods: [PUT]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:updatePetAction
|
_controller: open_api_server.controller.pet::updatePetAction
|
||||||
|
|
||||||
open_api_server_pet_updatepetwithform:
|
open_api_server_pet_updatepetwithform:
|
||||||
path: /pet/{petId}
|
path: /pet/{petId}
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:updatePetWithFormAction
|
_controller: open_api_server.controller.pet::updatePetWithFormAction
|
||||||
requirements:
|
requirements:
|
||||||
petId: '\d+'
|
petId: '\d+'
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ open_api_server_pet_uploadfile:
|
|||||||
path: /pet/{petId}/uploadImage
|
path: /pet/{petId}/uploadImage
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.pet:uploadFileAction
|
_controller: open_api_server.controller.pet::uploadFileAction
|
||||||
requirements:
|
requirements:
|
||||||
petId: '\d+'
|
petId: '\d+'
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ open_api_server_store_deleteorder:
|
|||||||
path: /store/order/{orderId}
|
path: /store/order/{orderId}
|
||||||
methods: [DELETE]
|
methods: [DELETE]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.store:deleteOrderAction
|
_controller: open_api_server.controller.store::deleteOrderAction
|
||||||
requirements:
|
requirements:
|
||||||
orderId: '[a-z0-9]+'
|
orderId: '[a-z0-9]+'
|
||||||
|
|
||||||
@ -72,13 +72,13 @@ open_api_server_store_getinventory:
|
|||||||
path: /store/inventory
|
path: /store/inventory
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.store:getInventoryAction
|
_controller: open_api_server.controller.store::getInventoryAction
|
||||||
|
|
||||||
open_api_server_store_getorderbyid:
|
open_api_server_store_getorderbyid:
|
||||||
path: /store/order/{orderId}
|
path: /store/order/{orderId}
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.store:getOrderByIdAction
|
_controller: open_api_server.controller.store::getOrderByIdAction
|
||||||
requirements:
|
requirements:
|
||||||
orderId: '\d+'
|
orderId: '\d+'
|
||||||
|
|
||||||
@ -86,32 +86,32 @@ open_api_server_store_placeorder:
|
|||||||
path: /store/order
|
path: /store/order
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.store:placeOrderAction
|
_controller: open_api_server.controller.store::placeOrderAction
|
||||||
|
|
||||||
# user
|
# user
|
||||||
open_api_server_user_createuser:
|
open_api_server_user_createuser:
|
||||||
path: /user
|
path: /user
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:createUserAction
|
_controller: open_api_server.controller.user::createUserAction
|
||||||
|
|
||||||
open_api_server_user_createuserswitharrayinput:
|
open_api_server_user_createuserswitharrayinput:
|
||||||
path: /user/createWithArray
|
path: /user/createWithArray
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:createUsersWithArrayInputAction
|
_controller: open_api_server.controller.user::createUsersWithArrayInputAction
|
||||||
|
|
||||||
open_api_server_user_createuserswithlistinput:
|
open_api_server_user_createuserswithlistinput:
|
||||||
path: /user/createWithList
|
path: /user/createWithList
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:createUsersWithListInputAction
|
_controller: open_api_server.controller.user::createUsersWithListInputAction
|
||||||
|
|
||||||
open_api_server_user_deleteuser:
|
open_api_server_user_deleteuser:
|
||||||
path: /user/{username}
|
path: /user/{username}
|
||||||
methods: [DELETE]
|
methods: [DELETE]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:deleteUserAction
|
_controller: open_api_server.controller.user::deleteUserAction
|
||||||
requirements:
|
requirements:
|
||||||
username: '[a-z0-9]+'
|
username: '[a-z0-9]+'
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ open_api_server_user_getuserbyname:
|
|||||||
path: /user/{username}
|
path: /user/{username}
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:getUserByNameAction
|
_controller: open_api_server.controller.user::getUserByNameAction
|
||||||
requirements:
|
requirements:
|
||||||
username: '[a-z0-9]+'
|
username: '[a-z0-9]+'
|
||||||
|
|
||||||
@ -127,19 +127,19 @@ open_api_server_user_loginuser:
|
|||||||
path: /user/login
|
path: /user/login
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:loginUserAction
|
_controller: open_api_server.controller.user::loginUserAction
|
||||||
|
|
||||||
open_api_server_user_logoutuser:
|
open_api_server_user_logoutuser:
|
||||||
path: /user/logout
|
path: /user/logout
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:logoutUserAction
|
_controller: open_api_server.controller.user::logoutUserAction
|
||||||
|
|
||||||
open_api_server_user_updateuser:
|
open_api_server_user_updateuser:
|
||||||
path: /user/{username}
|
path: /user/{username}
|
||||||
methods: [PUT]
|
methods: [PUT]
|
||||||
defaults:
|
defaults:
|
||||||
_controller: open_api_server.controller.user:updateUserAction
|
_controller: open_api_server.controller.user::updateUserAction
|
||||||
requirements:
|
requirements:
|
||||||
username: '[a-z0-9]+'
|
username: '[a-z0-9]+'
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ services:
|
|||||||
- [setSerializer, ['@open_api_server.service.serializer']]
|
- [setSerializer, ['@open_api_server.service.serializer']]
|
||||||
- [setValidator, ['@open_api_server.service.validator']]
|
- [setValidator, ['@open_api_server.service.validator']]
|
||||||
- [setApiServer, ['@open_api_server.api.api_server']]
|
- [setApiServer, ['@open_api_server.api.api_server']]
|
||||||
|
- [setContainer, ['@service_container']]
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
autowire: true
|
|
||||||
|
|
||||||
open_api_server.controller.store:
|
open_api_server.controller.store:
|
||||||
class: OpenAPI\Server\Controller\StoreController
|
class: OpenAPI\Server\Controller\StoreController
|
||||||
@ -36,8 +36,8 @@ services:
|
|||||||
- [setSerializer, ['@open_api_server.service.serializer']]
|
- [setSerializer, ['@open_api_server.service.serializer']]
|
||||||
- [setValidator, ['@open_api_server.service.validator']]
|
- [setValidator, ['@open_api_server.service.validator']]
|
||||||
- [setApiServer, ['@open_api_server.api.api_server']]
|
- [setApiServer, ['@open_api_server.api.api_server']]
|
||||||
|
- [setContainer, ['@service_container']]
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
autowire: true
|
|
||||||
|
|
||||||
open_api_server.controller.user:
|
open_api_server.controller.user:
|
||||||
class: OpenAPI\Server\Controller\UserController
|
class: OpenAPI\Server\Controller\UserController
|
||||||
@ -45,6 +45,6 @@ services:
|
|||||||
- [setSerializer, ['@open_api_server.service.serializer']]
|
- [setSerializer, ['@open_api_server.service.serializer']]
|
||||||
- [setValidator, ['@open_api_server.service.validator']]
|
- [setValidator, ['@open_api_server.service.validator']]
|
||||||
- [setApiServer, ['@open_api_server.api.api_server']]
|
- [setApiServer, ['@open_api_server.api.api_server']]
|
||||||
|
- [setContainer, ['@service_container']]
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
autowire: true
|
|
||||||
|
|
||||||
|
@ -16,11 +16,10 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
## Service Declaration
|
## Service Declaration
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.pet:
|
Acme\MyBundle\Api\PetApi:
|
||||||
class: Acme\MyBundle\Api\PetApi
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "open_api_server.api", api: "pet" }
|
- { name: "open_api_server.api", api: "pet" }
|
||||||
# ...
|
# ...
|
||||||
@ -58,7 +57,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#addPet
|
* Implementation of PetApiInterface#addPet
|
||||||
*/
|
*/
|
||||||
public function addPet(Pet $pet)
|
public function addPet(Pet $pet, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -120,7 +119,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#deletePet
|
* Implementation of PetApiInterface#deletePet
|
||||||
*/
|
*/
|
||||||
public function deletePet($petId, $apiKey = null)
|
public function deletePet($petId, $apiKey = null, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -183,7 +182,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#findPetsByStatus
|
* Implementation of PetApiInterface#findPetsByStatus
|
||||||
*/
|
*/
|
||||||
public function findPetsByStatus(array $status)
|
public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders): iterable
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -245,7 +244,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#findPetsByTags
|
* Implementation of PetApiInterface#findPetsByTags
|
||||||
*/
|
*/
|
||||||
public function findPetsByTags(array $tags)
|
public function findPetsByTags(array $tags, &$responseCode, array &$responseHeaders): iterable
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -307,7 +306,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#getPetById
|
* Implementation of PetApiInterface#getPetById
|
||||||
*/
|
*/
|
||||||
public function getPetById($petId)
|
public function getPetById($petId, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -369,7 +368,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#updatePet
|
* Implementation of PetApiInterface#updatePet
|
||||||
*/
|
*/
|
||||||
public function updatePet(Pet $pet)
|
public function updatePet(Pet $pet, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Pet
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -431,7 +430,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#updatePetWithForm
|
* Implementation of PetApiInterface#updatePetWithForm
|
||||||
*/
|
*/
|
||||||
public function updatePetWithForm($petId, $name = null, $status = null)
|
public function updatePetWithForm($petId, $name = null, $status = null, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -495,7 +494,7 @@ class PetApi implements PetApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of PetApiInterface#uploadFile
|
* Implementation of PetApiInterface#uploadFile
|
||||||
*/
|
*/
|
||||||
public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null)
|
public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\ApiResponse
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,10 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
## Service Declaration
|
## Service Declaration
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.store:
|
Acme\MyBundle\Api\StoreApi:
|
||||||
class: Acme\MyBundle\Api\StoreApi
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "open_api_server.api", api: "store" }
|
- { name: "open_api_server.api", api: "store" }
|
||||||
# ...
|
# ...
|
||||||
@ -46,7 +45,7 @@ class StoreApi implements StoreApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of StoreApiInterface#deleteOrder
|
* Implementation of StoreApiInterface#deleteOrder
|
||||||
*/
|
*/
|
||||||
public function deleteOrder($orderId)
|
public function deleteOrder($orderId, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -108,7 +107,7 @@ class StoreApi implements StoreApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of StoreApiInterface#getInventory
|
* Implementation of StoreApiInterface#getInventory
|
||||||
*/
|
*/
|
||||||
public function getInventory()
|
public function getInventory(, &$responseCode, array &$responseHeaders): array|\int
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -159,7 +158,7 @@ class StoreApi implements StoreApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of StoreApiInterface#getOrderById
|
* Implementation of StoreApiInterface#getOrderById
|
||||||
*/
|
*/
|
||||||
public function getOrderById($orderId)
|
public function getOrderById($orderId, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Order
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -213,7 +212,7 @@ class StoreApi implements StoreApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of StoreApiInterface#placeOrder
|
* Implementation of StoreApiInterface#placeOrder
|
||||||
*/
|
*/
|
||||||
public function placeOrder(Order $order)
|
public function placeOrder(Order $order, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\Order
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,10 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
## Service Declaration
|
## Service Declaration
|
||||||
```yaml
|
```yaml
|
||||||
# src/Acme/MyBundle/Resources/services.yml
|
# config/services.yml
|
||||||
services:
|
services:
|
||||||
# ...
|
# ...
|
||||||
acme.my_bundle.api.user:
|
Acme\MyBundle\Api\UserApi:
|
||||||
class: Acme\MyBundle\Api\UserApi
|
|
||||||
tags:
|
tags:
|
||||||
- { name: "open_api_server.api", api: "user" }
|
- { name: "open_api_server.api", api: "user" }
|
||||||
# ...
|
# ...
|
||||||
@ -58,7 +57,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#createUser
|
* Implementation of UserApiInterface#createUser
|
||||||
*/
|
*/
|
||||||
public function createUser(User $user)
|
public function createUser(User $user, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -120,7 +119,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#createUsersWithArrayInput
|
* Implementation of UserApiInterface#createUsersWithArrayInput
|
||||||
*/
|
*/
|
||||||
public function createUsersWithArrayInput(array $user)
|
public function createUsersWithArrayInput(array $user, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -182,7 +181,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#createUsersWithListInput
|
* Implementation of UserApiInterface#createUsersWithListInput
|
||||||
*/
|
*/
|
||||||
public function createUsersWithListInput(array $user)
|
public function createUsersWithListInput(array $user, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -244,7 +243,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#deleteUser
|
* Implementation of UserApiInterface#deleteUser
|
||||||
*/
|
*/
|
||||||
public function deleteUser($username)
|
public function deleteUser($username, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -298,7 +297,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#getUserByName
|
* Implementation of UserApiInterface#getUserByName
|
||||||
*/
|
*/
|
||||||
public function getUserByName($username)
|
public function getUserByName($username, &$responseCode, array &$responseHeaders): array|\OpenAPI\Server\Model\User
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -352,7 +351,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#loginUser
|
* Implementation of UserApiInterface#loginUser
|
||||||
*/
|
*/
|
||||||
public function loginUser($username, $password)
|
public function loginUser($username, $password, &$responseCode, array &$responseHeaders): array|\string
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -415,7 +414,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#logoutUser
|
* Implementation of UserApiInterface#logoutUser
|
||||||
*/
|
*/
|
||||||
public function logoutUser()
|
public function logoutUser(, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
@ -474,7 +473,7 @@ class UserApi implements UserApiInterface
|
|||||||
/**
|
/**
|
||||||
* Implementation of UserApiInterface#updateUser
|
* Implementation of UserApiInterface#updateUser
|
||||||
*/
|
*/
|
||||||
public function updateUser($username, User $user)
|
public function updateUser($username, User $user, &$responseCode, array &$responseHeaders): void
|
||||||
{
|
{
|
||||||
// Implement the operation ...
|
// Implement the operation ...
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
# InlineObject
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **string** | Updated name of the pet | [optional]
|
|
||||||
**status** | **string** | Updated status of the pet | [optional]
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
# InlineObject1
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**additionalMetadata** | **string** | Additional data to pass to server | [optional]
|
|
||||||
**file** | [**UploadedFile**](UploadedFile.md) | file to upload | [optional]
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -5,7 +5,9 @@ namespace OpenAPI\Server\Service;
|
|||||||
use JMS\Serializer\SerializerBuilder;
|
use JMS\Serializer\SerializerBuilder;
|
||||||
use JMS\Serializer\Naming\CamelCaseNamingStrategy;
|
use JMS\Serializer\Naming\CamelCaseNamingStrategy;
|
||||||
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
|
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
|
||||||
use JMS\Serializer\XmlDeserializationVisitor;
|
use JMS\Serializer\Visitor\Factory\XmlDeserializationVisitorFactory;
|
||||||
|
use DateTime;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
class JmsSerializer implements SerializerInterface
|
class JmsSerializer implements SerializerInterface
|
||||||
{
|
{
|
||||||
@ -13,10 +15,11 @@ class JmsSerializer implements SerializerInterface
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$naming_strategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
|
$namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
|
||||||
$this->serializer = SerializerBuilder::create()
|
$this->serializer = SerializerBuilder::create()
|
||||||
->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy))
|
->setDeserializationVisitor('json', new StrictJsonDeserializationVisitorFactory())
|
||||||
->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy))
|
->setDeserializationVisitor('xml', new XmlDeserializationVisitorFactory())
|
||||||
|
->setPropertyNamingStrategy($namingStrategy)
|
||||||
->build();
|
->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +82,11 @@ class JmsSerializer implements SerializerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case 'DateTime':
|
||||||
|
case '\DateTime':
|
||||||
|
return new DateTime($data);
|
||||||
|
default:
|
||||||
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we end up here, just return data
|
// If we end up here, just return data
|
||||||
|
@ -15,58 +15,145 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace OpenAPI\Server\Service;
|
namespace OpenAPI\Server\Service;
|
||||||
|
|
||||||
use JMS\Serializer\Context;
|
|
||||||
use JMS\Serializer\JsonDeserializationVisitor;
|
use JMS\Serializer\JsonDeserializationVisitor;
|
||||||
|
use JMS\Serializer\GraphNavigatorInterface;
|
||||||
|
use JMS\Serializer\Metadata\ClassMetadata;
|
||||||
|
use JMS\Serializer\Metadata\PropertyMetadata;
|
||||||
|
use JMS\Serializer\Visitor\DeserializationVisitorInterface;
|
||||||
|
|
||||||
class StrictJsonDeserializationVisitor extends JsonDeserializationVisitor
|
class StrictJsonDeserializationVisitor implements DeserializationVisitorInterface
|
||||||
{
|
{
|
||||||
|
protected $jsonDeserializationVisitor: JsonDeserializationVisitor;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
int $options = 0,
|
||||||
|
int $depth = 512
|
||||||
|
) {
|
||||||
|
$this->jsonDeserializationVisitor = new JsonDeserializationVisitor($options, $depth);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitString($data, array $type, Context $context)
|
public function visitNull($data, array $type)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitNull($data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitString($data, array $type): string
|
||||||
{
|
{
|
||||||
if (!is_string($data)) {
|
if (!is_string($data)) {
|
||||||
throw TypeMismatchException::fromValue('string', $data, $context);
|
throw TypeMismatchException::fromValue('string', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitString($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitString($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitBoolean($data, array $type, Context $context)
|
public function visitBoolean($data, array $type): bool
|
||||||
{
|
{
|
||||||
if (!is_bool($data)) {
|
if (!is_bool($data)) {
|
||||||
throw TypeMismatchException::fromValue('boolean', $data, $context);
|
throw TypeMismatchException::fromValue('boolean', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitBoolean($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitBoolean($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitInteger($data, array $type, Context $context)
|
public function visitInteger($data, array $type): int
|
||||||
{
|
{
|
||||||
if (!is_int($data)) {
|
if (!is_int($data)) {
|
||||||
throw TypeMismatchException::fromValue('integer', $data, $context);
|
throw TypeMismatchException::fromValue('integer', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitInteger($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitInteger($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function visitDouble($data, array $type, Context $context)
|
public function visitDouble($data, array $type): float
|
||||||
{
|
{
|
||||||
if (!is_float($data) && !is_integer($data)) {
|
if (!is_float($data) && !is_integer($data)) {
|
||||||
throw TypeMismatchException::fromValue('double', $data, $context);
|
throw TypeMismatchException::fromValue('double', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::visitDouble($data, $type, $context);
|
return $this->jsonDeserializationVisitor->visitDouble($data, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitArray($data, array $type): array
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitArray($data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitDiscriminatorMapProperty($data, ClassMetadata $metadata): string
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitDiscriminatorMapProperty($data, $metadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function startVisitingObject(ClassMetadata $metadata, object $data, array $type): void
|
||||||
|
{
|
||||||
|
$this->jsonDeserializationVisitor->startVisitingObject($metadata, $data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function visitProperty(PropertyMetadata $metadata, $data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->visitProperty($metadata, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function endVisitingObject(ClassMetadata $metadata, $data, array $type): object
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->endVisitingObject($metadata, $data, $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getResult($data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->getResult($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function prepare($data)
|
||||||
|
{
|
||||||
|
return $this->jsonDeserializationVisitor->prepare($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function setNavigator(GraphNavigatorInterface $navigator): void
|
||||||
|
{
|
||||||
|
$this->jsonDeserializationVisitor->setNavigator($navigator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace OpenAPI\Server\Service;
|
||||||
|
|
||||||
|
use JMS\Serializer\Visitor\DeserializationVisitorInterface;
|
||||||
|
use JMS\Serializer\Visitor\Factory\DeserializationVisitorFactory;
|
||||||
|
|
||||||
|
final class StrictJsonDeserializationVisitorFactory implements DeserializationVisitorFactory
|
||||||
|
{
|
||||||
|
private int $options = 0;
|
||||||
|
|
||||||
|
private int $depth = 512;
|
||||||
|
|
||||||
|
public function getVisitor(): DeserializationVisitorInterface
|
||||||
|
{
|
||||||
|
return new StrictJsonDeserializationVisitor($this->options, $this->depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOptions(int $options): self
|
||||||
|
{
|
||||||
|
$this->options = $options;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDepth(int $depth): self
|
||||||
|
{
|
||||||
|
$this->depth = $depth;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PetApiInterfaceTest
|
* PetApiInterfaceTest
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Api
|
* @package OpenAPI\Server\Tests\Api
|
||||||
@ -32,6 +32,7 @@ use OpenAPI\Server\Configuration;
|
|||||||
use OpenAPI\Server\ApiClient;
|
use OpenAPI\Server\ApiClient;
|
||||||
use OpenAPI\Server\ApiException;
|
use OpenAPI\Server\ApiException;
|
||||||
use OpenAPI\Server\ObjectSerializer;
|
use OpenAPI\Server\ObjectSerializer;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,32 +45,37 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
class PetApiInterfaceTest extends WebTestCase
|
class PetApiInterfaceTest extends WebTestCase
|
||||||
{
|
{
|
||||||
|
private static ?KernelBrowser $client = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running any test cases
|
* Setup before running any test cases
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
if (null === self::$client) {
|
||||||
|
self::$client = static::createClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
|
static::ensureKernelShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +87,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testAddPet()
|
public function testAddPet()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet';
|
$path = '/pet';
|
||||||
|
|
||||||
@ -96,7 +102,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeletePet()
|
public function testDeletePet()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/{petId}';
|
$path = '/pet/{petId}';
|
||||||
$pattern = '{petId}';
|
$pattern = '{petId}';
|
||||||
@ -114,7 +120,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testFindPetsByStatus()
|
public function testFindPetsByStatus()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/findByStatus';
|
$path = '/pet/findByStatus';
|
||||||
|
|
||||||
@ -129,7 +135,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testFindPetsByTags()
|
public function testFindPetsByTags()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/findByTags';
|
$path = '/pet/findByTags';
|
||||||
|
|
||||||
@ -144,7 +150,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetPetById()
|
public function testGetPetById()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/{petId}';
|
$path = '/pet/{petId}';
|
||||||
$pattern = '{petId}';
|
$pattern = '{petId}';
|
||||||
@ -162,7 +168,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdatePet()
|
public function testUpdatePet()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet';
|
$path = '/pet';
|
||||||
|
|
||||||
@ -177,7 +183,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdatePetWithForm()
|
public function testUpdatePetWithForm()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/{petId}';
|
$path = '/pet/{petId}';
|
||||||
$pattern = '{petId}';
|
$pattern = '{petId}';
|
||||||
@ -195,7 +201,7 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testUploadFile()
|
public function testUploadFile()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/pet/{petId}/uploadImage';
|
$path = '/pet/{petId}/uploadImage';
|
||||||
$pattern = '{petId}';
|
$pattern = '{petId}';
|
||||||
@ -212,6 +218,6 @@ class PetApiInterfaceTest extends WebTestCase
|
|||||||
$ast = $compiler->parse($regexp);
|
$ast = $compiler->parse($regexp);
|
||||||
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
||||||
|
|
||||||
return $generator->visit($ast);
|
return $generator->visit($ast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* StoreApiInterfaceTest
|
* StoreApiInterfaceTest
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Api
|
* @package OpenAPI\Server\Tests\Api
|
||||||
@ -32,6 +32,7 @@ use OpenAPI\Server\Configuration;
|
|||||||
use OpenAPI\Server\ApiClient;
|
use OpenAPI\Server\ApiClient;
|
||||||
use OpenAPI\Server\ApiException;
|
use OpenAPI\Server\ApiException;
|
||||||
use OpenAPI\Server\ObjectSerializer;
|
use OpenAPI\Server\ObjectSerializer;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,32 +45,37 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
class StoreApiInterfaceTest extends WebTestCase
|
class StoreApiInterfaceTest extends WebTestCase
|
||||||
{
|
{
|
||||||
|
private static ?KernelBrowser $client = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running any test cases
|
* Setup before running any test cases
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
if (null === self::$client) {
|
||||||
|
self::$client = static::createClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
|
static::ensureKernelShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +87,7 @@ class StoreApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeleteOrder()
|
public function testDeleteOrder()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/store/order/{orderId}';
|
$path = '/store/order/{orderId}';
|
||||||
$pattern = '{orderId}';
|
$pattern = '{orderId}';
|
||||||
@ -99,7 +105,7 @@ class StoreApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInventory()
|
public function testGetInventory()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/store/inventory';
|
$path = '/store/inventory';
|
||||||
|
|
||||||
@ -114,7 +120,7 @@ class StoreApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetOrderById()
|
public function testGetOrderById()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/store/order/{orderId}';
|
$path = '/store/order/{orderId}';
|
||||||
$pattern = '{orderId}';
|
$pattern = '{orderId}';
|
||||||
@ -132,7 +138,7 @@ class StoreApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testPlaceOrder()
|
public function testPlaceOrder()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/store/order';
|
$path = '/store/order';
|
||||||
|
|
||||||
@ -146,6 +152,6 @@ class StoreApiInterfaceTest extends WebTestCase
|
|||||||
$ast = $compiler->parse($regexp);
|
$ast = $compiler->parse($regexp);
|
||||||
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
||||||
|
|
||||||
return $generator->visit($ast);
|
return $generator->visit($ast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* UserApiInterfaceTest
|
* UserApiInterfaceTest
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Api
|
* @package OpenAPI\Server\Tests\Api
|
||||||
@ -32,6 +32,7 @@ use OpenAPI\Server\Configuration;
|
|||||||
use OpenAPI\Server\ApiClient;
|
use OpenAPI\Server\ApiClient;
|
||||||
use OpenAPI\Server\ApiException;
|
use OpenAPI\Server\ApiException;
|
||||||
use OpenAPI\Server\ObjectSerializer;
|
use OpenAPI\Server\ObjectSerializer;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,32 +45,37 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
class UserApiInterfaceTest extends WebTestCase
|
class UserApiInterfaceTest extends WebTestCase
|
||||||
{
|
{
|
||||||
|
private static ?KernelBrowser $client = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running any test cases
|
* Setup before running any test cases
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
|
if (null === self::$client) {
|
||||||
|
self::$client = static::createClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
|
static::ensureKernelShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +87,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testCreateUser()
|
public function testCreateUser()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user';
|
$path = '/user';
|
||||||
|
|
||||||
@ -96,7 +102,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testCreateUsersWithArrayInput()
|
public function testCreateUsersWithArrayInput()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/createWithArray';
|
$path = '/user/createWithArray';
|
||||||
|
|
||||||
@ -111,7 +117,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testCreateUsersWithListInput()
|
public function testCreateUsersWithListInput()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/createWithList';
|
$path = '/user/createWithList';
|
||||||
|
|
||||||
@ -126,7 +132,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeleteUser()
|
public function testDeleteUser()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/{username}';
|
$path = '/user/{username}';
|
||||||
$pattern = '{username}';
|
$pattern = '{username}';
|
||||||
@ -144,7 +150,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetUserByName()
|
public function testGetUserByName()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/{username}';
|
$path = '/user/{username}';
|
||||||
$pattern = '{username}';
|
$pattern = '{username}';
|
||||||
@ -162,7 +168,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testLoginUser()
|
public function testLoginUser()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/login';
|
$path = '/user/login';
|
||||||
|
|
||||||
@ -177,7 +183,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testLogoutUser()
|
public function testLogoutUser()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/logout';
|
$path = '/user/logout';
|
||||||
|
|
||||||
@ -192,7 +198,7 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdateUser()
|
public function testUpdateUser()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
$client = self::$client;
|
||||||
|
|
||||||
$path = '/user/{username}';
|
$path = '/user/{username}';
|
||||||
$pattern = '{username}';
|
$pattern = '{username}';
|
||||||
@ -209,6 +215,6 @@ class UserApiInterfaceTest extends WebTestCase
|
|||||||
$ast = $compiler->parse($regexp);
|
$ast = $compiler->parse($regexp);
|
||||||
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());
|
||||||
|
|
||||||
return $generator->visit($ast);
|
return $generator->visit($ast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ use Symfony\Component\Config\Loader\LoaderInterface;
|
|||||||
|
|
||||||
class AppKernel extends Kernel
|
class AppKernel extends Kernel
|
||||||
{
|
{
|
||||||
public function registerBundles()
|
public function registerBundles(): iterable
|
||||||
{
|
{
|
||||||
$bundles = array(
|
$bundles = array(
|
||||||
new FrameworkBundle()
|
new FrameworkBundle()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ControllerTest
|
* ControllerTest
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Controller
|
* @package OpenAPI\Server\Tests\Controller
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ApiResponseTest
|
* ApiResponseTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class ApiResponseTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* CategoryTest
|
* CategoryTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class CategoryTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* InlineObject1Test
|
|
||||||
*
|
|
||||||
* PHP version 7.1.3
|
|
||||||
*
|
|
||||||
* @category Class
|
|
||||||
* @package OpenAPI\Server\Tests\Model
|
|
||||||
* @author openapi-generator contributors
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
*
|
|
||||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
||||||
*
|
|
||||||
* The version of the OpenAPI document: 1.0.0
|
|
||||||
*
|
|
||||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 OpenAPI\Server\Model;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* InlineObject1Test Class Doc Comment
|
|
||||||
*
|
|
||||||
* @category Class */
|
|
||||||
// * @description InlineObject1
|
|
||||||
/**
|
|
||||||
* @package OpenAPI\Server\Tests\Model
|
|
||||||
* @author openapi-generator contributors
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
class InlineObject1Test 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 "InlineObject1"
|
|
||||||
*/
|
|
||||||
public function testInlineObject1()
|
|
||||||
{
|
|
||||||
$testInlineObject1 = new InlineObject1();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test attribute "additionalMetadata"
|
|
||||||
*/
|
|
||||||
public function testPropertyAdditionalMetadata()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test attribute "file"
|
|
||||||
*/
|
|
||||||
public function testPropertyFile()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* InlineObjectTest
|
|
||||||
*
|
|
||||||
* PHP version 7.1.3
|
|
||||||
*
|
|
||||||
* @category Class
|
|
||||||
* @package OpenAPI\Server\Tests\Model
|
|
||||||
* @author openapi-generator contributors
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OpenAPI Petstore
|
|
||||||
*
|
|
||||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
||||||
*
|
|
||||||
* The version of the OpenAPI document: 1.0.0
|
|
||||||
*
|
|
||||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 OpenAPI\Server\Model;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* InlineObjectTest Class Doc Comment
|
|
||||||
*
|
|
||||||
* @category Class */
|
|
||||||
// * @description InlineObject
|
|
||||||
/**
|
|
||||||
* @package OpenAPI\Server\Tests\Model
|
|
||||||
* @author openapi-generator contributors
|
|
||||||
* @link https://github.com/openapitools/openapi-generator
|
|
||||||
*/
|
|
||||||
class InlineObjectTest 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 "InlineObject"
|
|
||||||
*/
|
|
||||||
public function testInlineObject()
|
|
||||||
{
|
|
||||||
$testInlineObject = new InlineObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test attribute "name"
|
|
||||||
*/
|
|
||||||
public function testPropertyName()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test attribute "status"
|
|
||||||
*/
|
|
||||||
public function testPropertyStatus()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OrderTest
|
* OrderTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class OrderTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* PetTest
|
* PetTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class PetTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* TagTest
|
* TagTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class TagTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* UserTest
|
* UserTest
|
||||||
*
|
*
|
||||||
* PHP version 7.1.3
|
* PHP version 8.1.1
|
||||||
*
|
*
|
||||||
* @category Class
|
* @category Class
|
||||||
* @package OpenAPI\Server\Tests\Model
|
* @package OpenAPI\Server\Tests\Model
|
||||||
@ -47,28 +47,28 @@ class UserTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Setup before running any test case
|
* Setup before running any test case
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup before running each test case
|
* Setup before running each test case
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running each test case
|
* Clean up after running each test case
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up after running all test cases
|
* Clean up after running all test cases
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass(): void
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,4 +5,4 @@ framework:
|
|||||||
secret: "testsecret"
|
secret: "testsecret"
|
||||||
test: ~
|
test: ~
|
||||||
router:
|
router:
|
||||||
resource: "%kernel.root_dir%/../Resources/config/routing.yml"
|
resource: "%kernel.project_dir%/../Resources/config/routing.yml"
|
||||||
|
@ -16,22 +16,24 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1.3",
|
"php": ">=7.4.0|>=8.0.2",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"symfony/validator": "*",
|
"symfony/validator": "^5.0|^6.0",
|
||||||
"jms/serializer-bundle": "^2.0",
|
"jms/serializer-bundle": "^4.0",
|
||||||
"symfony/framework-bundle": "^4.4.8"
|
"symfony/framework-bundle": "^5.0|^6.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^9.5",
|
||||||
"friendsofphp/php-cs-fixer": "^2.16.3",
|
"friendsofphp/php-cs-fixer": "^2.16.3",
|
||||||
"symfony/browser-kit": "*",
|
"symfony/browser-kit": "^5.0|^6.0",
|
||||||
"symfony/yaml": "^4.4.8",
|
"symfony/yaml": "^5.0|^6.0",
|
||||||
"hoa/regex": "~1.0"
|
"hoa/regex": "~1.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "OpenAPI\\Server\\" : "./" }
|
"psr-4": {
|
||||||
|
"OpenAPI\\Server\\" : "./"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user