Skip to content

Commit

Permalink
fix: restore codegenUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
kridai committed Oct 11, 2023
1 parent 19b04b9 commit c9f611f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/twilio/oai/CodegenUtils.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package com.twilio.oai;

import java.util.LinkedHashMap;
import java.util.Map;
import org.openapitools.codegen.CodegenParameter;
import org.openapitools.codegen.CodegenProperty;

public class CodegenUtils {

private CodegenUtils() {

}

public static boolean isPropertySchemaEnum(CodegenProperty codegenProperty) {
if(codegenProperty.isEnum) {
return true;
Expand Down Expand Up @@ -49,4 +55,13 @@ public static boolean isParameterSchemaEnumJava(CodegenParameter codegenParamete
&& codegenParameter.items.allowableValues.containsKey(TwilioJavaGenerator.VALUES));
return enumValues || listEnumValues;
}

public static void mergeVendorExtensionProperty(Map<String, Object> vendorExtensions, Map<String, Object> value, String field ) {
if (value != null && !value.isEmpty()) {
if( vendorExtensions.containsKey(field))
((LinkedHashMap<String, Object>)vendorExtensions.get(field)).putAll(value);
else
vendorExtensions.put(field, value);
}
}
}

0 comments on commit c9f611f

Please sign in to comment.