Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Dec 15, 2023
1 parent 5394da8 commit 6ce3363
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym
break;
case INT_SIGNED32:
Schema int32Schema = new IntegerSchema().description(typeDoc).format("int32");
setConstraintValueToSchema(constraintAnnot, int32Schema);
schema.put(componentName, int32Schema);
components.setSchemas(schema);
break;

Check warning on line 146 in openapi-bal-service/src/main/java/io/ballerina/openapi/converter/service/OpenAPIComponentMapper.java

View check run for this annotation

Codecov / codecov/patch

openapi-bal-service/src/main/java/io/ballerina/openapi/converter/service/OpenAPIComponentMapper.java#L143-L146

Added lines #L143 - L146 were not covered by tests
Expand All @@ -151,7 +150,6 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym
case INT_UNSIGNED8:
case INT_SIGNED8:
Schema subIntSchema = new IntegerSchema().description(typeDoc).format(null);
setConstraintValueToSchema(constraintAnnot, subIntSchema);
schema.put(componentName, subIntSchema);
components.setSchemas(schema);
break;

Check warning on line 155 in openapi-bal-service/src/main/java/io/ballerina/openapi/converter/service/OpenAPIComponentMapper.java

View check run for this annotation

Codecov / codecov/patch

openapi-bal-service/src/main/java/io/ballerina/openapi/converter/service/OpenAPIComponentMapper.java#L152-L155

Added lines #L152 - L155 were not covered by tests
Expand Down Expand Up @@ -218,13 +216,22 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym

public static boolean isBuiltInSubTypes(TypeReferenceTypeSymbol typeSymbol) {
TypeSymbol referredType = typeSymbol.typeDescriptor();
return switch (referredType.typeKind()) {
case INT_SIGNED8, INT_SIGNED16, INT_SIGNED32, INT_UNSIGNED8, INT_UNSIGNED16, INT_UNSIGNED32,
XML_COMMENT, XML_ELEMENT, XML_PROCESSING_INSTRUCTION, XML_TEXT,
STRING_CHAR->
true;
default -> false;
};
switch (referredType.typeKind()) {
case INT_SIGNED8:
case INT_SIGNED16:
case INT_SIGNED32:
case INT_UNSIGNED8:
case INT_UNSIGNED16:
case INT_UNSIGNED32:
case XML_COMMENT:
case XML_ELEMENT:
case XML_PROCESSING_INSTRUCTION:
case XML_TEXT:
case STRING_CHAR:
return true;
default:
return false;
}
}

/**
Expand Down

0 comments on commit 6ce3363

Please sign in to comment.