Bug Report Checklist
Description
Some of the PHP code generated by the openapi-generator seems to be references response models incorrectly, resulting in classes not being found.
openapi-generator version
I am using version 4.0.1 on the openapi-generator on Mac OS 10.14.5.
OpenAPI declaration file content or url
200UserAuthenticatedResponse:
description: Successful user login response
headers:
X-Request-Id:
$ref: "#/components/headers/X-Request-Id"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ApiResponseCommonValues"
- type: object
required:
- details
properties:
details:
$ref: "#/components/schemas/LoginAuthenticatedResponse"
switch($statusCode) {
case 200:
if ('ApiResponseCommonValues' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, 'ApiResponseCommonValues', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 400:
if ('\TheSupportGroup\easyfundraising\ApiClient\Model\ApiBadResponseError' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiBadResponseError', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 401:
if ('\TheSupportGroup\easyfundraising\ApiClient\Model\ApiBadResponseError' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiBadResponseError', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 404:
if ('\TheSupportGroup\easyfundraising\ApiClient\Model\ApiSimpleResponseError' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiSimpleResponseError', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 500:
if ('\TheSupportGroup\easyfundraising\ApiClient\Model\ApiResponseError' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiResponseError', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
Many of the response models are ok, but the reference to ApiResponseCommonValues is invalid. The class should be references as '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiResponseCommonValues' the same way as all other response models.
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate
-i /local/openapi.yaml
-g php
-o /local/out/php
--skip-validate-spec
--package-name "easyfundraising APIv3 PHP Client"
--invoker-package TheSupportGroup\easyfundraising\ApiClient
--additional-properties variableNamingConvention=camelCase
Bug Report Checklist
Description
Some of the PHP code generated by the openapi-generator seems to be references response models incorrectly, resulting in classes not being found.
openapi-generator version
I am using version 4.0.1 on the openapi-generator on Mac OS 10.14.5.
OpenAPI declaration file content or url
Many of the response models are ok, but the reference to
ApiResponseCommonValuesis invalid. The class should be references as '\TheSupportGroup\easyfundraising\ApiClient\Model\ApiResponseCommonValues' the same way as all other response models.Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate
-i /local/openapi.yaml
-g php
-o /local/out/php
--skip-validate-spec
--package-name "easyfundraising APIv3 PHP Client"
--invoker-package TheSupportGroup\easyfundraising\ApiClient
--additional-properties variableNamingConvention=camelCase