swagger-editor
swagger-editor copied to clipboard
Default constructors missing in Generate Client (Java) - classes (models)
Might be up for discussion, default constructors are not included in the generation (important when said model is 'wrapped')
Why suggested (example problem from hosted swagger being called via postman):
Cannot Construct Instance Of XYZ
(No Creators, Like Default Construct, Exist): Cannot Deserialize From Object Value (No Delegate- Or Property-Based Creator)
Path to generated classes: java-client\src\main\java\io\swagger\client\model
I overcame the problem in the interim by manually editing the class - adding a default constructor(s).
public GeneratedModelClass(){
super();
}
public GeneratedModelClass(int i, String s){
this.i= i;
this.s= s;
}