diff --git a/openapi-bal-service/src/main/java/io/ballerina/openapi/converter/utils/ConverterCommonUtils.java b/openapi-bal-service/src/main/java/io/ballerina/openapi/converter/utils/ConverterCommonUtils.java index 0f2b983a0..78e068ef0 100644 --- a/openapi-bal-service/src/main/java/io/ballerina/openapi/converter/utils/ConverterCommonUtils.java +++ b/openapi-bal-service/src/main/java/io/ballerina/openapi/converter/utils/ConverterCommonUtils.java @@ -161,16 +161,14 @@ public static Schema getOpenApiSchema(String type) { schema = new ObjectSchema(); schema.setAdditionalProperties(new StringSchema()); break; + case Constants.TYPE_REFERENCE: + case Constants.TYPEREFERENCE: case Constants.XML: case Constants.XML_ELEMENT: case Constants.XML_PROCESSING_INSTRUCTION: case Constants.XML_TEXT: case Constants.XML_COMMENT: case Constants.JSON: - schema = new ObjectSchema(); - break; - case Constants.TYPE_REFERENCE: - case Constants.TYPEREFERENCE: default: schema = new Schema<>(); break; diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/data_type/built_in_sub_types_in_record.yaml b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/data_type/built_in_sub_types_in_record.yaml index ae4379fd6..6d5b23773 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/data_type/built_in_sub_types_in_record.yaml +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/data_type/built_in_sub_types_in_record.yaml @@ -56,14 +56,10 @@ components: - text type: object properties: - comment: - type: object - element: - type: object - processingInstruction: - type: object - text: - type: object + comment: {} + element: {} + processingInstruction: {} + text: {} BalInts: required: - signed