Skip to content

Commit

Permalink
Fix bad sad error
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Dec 15, 2023
1 parent 6ce3363 commit 8aa2a5c
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym
}
TypeReferenceTypeSymbol typeRef = (TypeReferenceTypeSymbol) typeSymbol;
TypeSymbol type = typeRef.typeDescriptor();
if (type instanceof TypeReferenceTypeSymbol && isBuiltInSubTypes((TypeReferenceTypeSymbol) type)) {
type = ((TypeReferenceTypeSymbol) type).typeDescriptor();
}

if (type.typeKind() == TypeDescKind.INTERSECTION) {
type = excludeReadonlyIfPresent(type);
Expand All @@ -113,10 +116,6 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym
handleRecordTypeSymbol((RecordTypeSymbol) type, schema, componentName, apiDocs);
break;
case TYPE_REFERENCE:
if (isBuiltInSubTypes((TypeReferenceTypeSymbol) type)) {
createComponentSchema(schema, ((TypeReferenceTypeSymbol) type).typeDescriptor());
break;
}
schema.put(componentName, new ObjectSchema().$ref(ConverterCommonUtils.unescapeIdentifier(
type.getName().orElseThrow().trim())));
components.setSchemas(schema);
Expand All @@ -127,11 +126,17 @@ public void createComponentSchema(Map<String, Schema> schema, TypeSymbol typeSym
}
break;
case STRING:
schema.put(componentName, new StringSchema().description(typeDoc));
case STRING_CHAR:
Schema stringSchema = new StringSchema().description(typeDoc);
schema.put(componentName, stringSchema);
components.setSchemas(schema);
break;
case JSON:
case XML:
case XML_ELEMENT:
case XML_PROCESSING_INSTRUCTION:
case XML_TEXT:
case XML_COMMENT:
schema.put(componentName, new ObjectSchema().description(typeDoc));
components.setSchemas(schema);
break;
Expand Down

0 comments on commit 8aa2a5c

Please sign in to comment.