Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class ObjectSerializer
// If a discriminator is defined and points to a valid subclass, use it.
$discriminator = $class::DISCRIMINATOR;
if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) {
$subclass = '\{{invokerPackage}}\Model\\' . $data->{$discriminator};
$subclass = '\{{modelPackage}}\\' . $data->{$discriminator};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR

what about adding a test schema in modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml to cover this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for the late reply. My poor brain forgot about it completly. Tests commited.

if (is_subclass_of($subclass, $class)) {
$class = $subclass;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,29 @@ import {
export class TestApi extends runtime.BaseAPI {

/**
* Creates request options for test without sending the request
*/
async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TestBaseDto>>> {
async testRequestOpts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.RequestOpts> {
const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};


let urlPath = `/api/v1/test`;

const response = await this.request({
return {
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
};
}

/**
*/
async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TestBaseDto>>> {
const requestConfig = await this.testRequestConfig(initOverrides);
const response = await this.request(requestConfig, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TestBaseDtoFromJSON));
}
Expand Down
Loading