Bug Report Checklist
Description
Json is gnerated from Php codebase usnig nelmio/api-doc-bundle.
On nested classes (properties, not extension), the js client will start calling validateJson on class that doesn't have that method.
It happens on validateJson method that call other class validateJson, but there is a "proxy class" between both.
Here is a repo with the generated js client for my openapi json : https://github.com/etshy/bad-generated-openapi-js-client
You can see in AddThingsCommand.js, validateJSON method, it try to call AddThingsCommandThings.validateJSON() but the method doesn't exists.
It should do ThingsDto.validateJSON() because AddThingsCommandThings is a "proxy" to ThingDto.
Noting that the generated client is good when using allOf, but nelmio bundle change all allOf to oneOf from v4.13 to follow a change on zircote/swagger-php : nelmio/NelmioApiDocBundle#2156
openapi-generator version
7.0.1 and 7.7.0 using javascript generator
OpenAPI declaration file content or url
Json
Gist
Generation Details
java -jar openapi-generator-cli-7.7.0.jar generate -i ./minimalopenapi.json -g javascript -o ./path/to/
with minimalopenapi.json the gist I linked
Steps to reproduce
Generate js client with provided openapi json
Suggest a fix
When using oneOf and there is a sort of "proxy" class, guess the real class/dto and call validateJson on it instead of the proxy.
Bug Report Checklist
Tested on latest release, not latest master.
Description
Json is gnerated from Php codebase usnig nelmio/api-doc-bundle.
On nested classes (properties, not extension), the js client will start calling
validateJsonon class that doesn't have that method.It happens on
validateJsonmethod that call other classvalidateJson, but there is a "proxy class" between both.Here is a repo with the generated js client for my openapi json : https://github.com/etshy/bad-generated-openapi-js-client
You can see in
AddThingsCommand.js,validateJSONmethod, it try to callAddThingsCommandThings.validateJSON()but the method doesn't exists.It should do
ThingsDto.validateJSON()becauseAddThingsCommandThingsis a "proxy" toThingDto.Noting that the generated client is good when using
allOf, but nelmio bundle change allallOftooneOffrom v4.13 to follow a change onzircote/swagger-php: nelmio/NelmioApiDocBundle#2156openapi-generator version
7.0.1 and 7.7.0 using
javascriptgeneratorOpenAPI declaration file content or url
Json
Gist
Generation Details
java -jar openapi-generator-cli-7.7.0.jar generate -i ./minimalopenapi.json -g javascript -o ./path/to/with
minimalopenapi.jsonthe gist I linkedSteps to reproduce
Generate js client with provided openapi json
Suggest a fix
When using
oneOfand there is a sort of "proxy" class, guess the real class/dto and callvalidateJsonon it instead of the proxy.