You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Constructs a <code>ID</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ID} obj Optional instance to populate.
* @return {module:model/ID} The populated <code>ID</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
}
return obj;
}
data is an integer input. obj is null. Hence, the result is exports() instead of simply data.
/**
* Constructs a <code>ID</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ID} obj Optional instance to populate.
* @return {module:model/ID} The populated <code>ID</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = **data** || new exports();
}
return obj;
}
but I actually think the issue is that the generator doesn't follow the $ref properly. Not certain
The text was updated successfully, but these errors were encountered:
Description
Generated type file
ID
contains the following:data
is an integer input.obj
is null. Hence, the result isexports()
instead of simplydata
.openapi-generator version
openapi-generator-cli-3.3.3-20181113.090410-41.jar
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli-3.3.3-20181113.090410-41.jar generate -i ../source.yaml -l javascript --additional-properties usePromises=true -o ./javascript/
Steps to reproduce
Use the above definitions in any operation. You'll get a result object with an exports() objects instead of an ID integer.
Related issues/PRs
This is the same issue in swagger-codegen:
swagger-api/swagger-codegen#4973
Suggest a fix/enhancement
It tempts me to say:
but I actually think the issue is that the generator doesn't follow the $ref properly. Not certain
The text was updated successfully, but these errors were encountered: