forked from loafle/openapi-generator-original
Enable useOneOfInterfaces for the ruby generator (#8061)
Tested against https://ftc-events.firstinspires.org/swagger/v2.0/swagger.json Used to generate un-runnable code, now it works
This commit is contained in:
@@ -622,6 +622,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
*
|
||||
* @param objs Map of models
|
||||
* @return maps of models with better enum support
|
||||
*
|
||||
*/
|
||||
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
|
||||
List<Object> models = (List<Object>) objs.get("models");
|
||||
@@ -6473,6 +6474,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
cm.classname = type;
|
||||
cm.vendorExtensions.put("x-is-one-of-interface", true);
|
||||
cm.interfaceModels = new ArrayList<CodegenModel>();
|
||||
cm.classFilename = toModelFilename(type);
|
||||
|
||||
addOneOfInterfaces.add(cm);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
|
||||
);
|
||||
|
||||
supportsInheritance = true;
|
||||
useOneOfInterfaces = true;
|
||||
|
||||
// clear import mapping (from default generator) as ruby does not use it
|
||||
// at the moment
|
||||
|
||||
Reference in New Issue
Block a user