From c9f611f04a5e37d37a0fe4e14566df13a2d6e0e1 Mon Sep 17 00:00:00 2001 From: kridai Date: Wed, 11 Oct 2023 12:34:57 +0530 Subject: [PATCH] fix: restore codegenUtil --- src/main/java/com/twilio/oai/CodegenUtils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/twilio/oai/CodegenUtils.java b/src/main/java/com/twilio/oai/CodegenUtils.java index 2b81d8fac..49ffeca26 100644 --- a/src/main/java/com/twilio/oai/CodegenUtils.java +++ b/src/main/java/com/twilio/oai/CodegenUtils.java @@ -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; @@ -49,4 +55,13 @@ public static boolean isParameterSchemaEnumJava(CodegenParameter codegenParamete && codegenParameter.items.allowableValues.containsKey(TwilioJavaGenerator.VALUES)); return enumValues || listEnumValues; } + + public static void mergeVendorExtensionProperty(Map vendorExtensions, Map value, String field ) { + if (value != null && !value.isEmpty()) { + if( vendorExtensions.containsKey(field)) + ((LinkedHashMap)vendorExtensions.get(field)).putAll(value); + else + vendorExtensions.put(field, value); + } + } } \ No newline at end of file