Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirhoshan committed Feb 7, 2024
1 parent 3ed554f commit 491600f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ballerina/openapi_utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class OpenApiSpecVisitor {
return error UnsupportedMediaTypeError("Only json, xml or text content is supported.", availableContentTypes = content.keys());
}

private isolated function visitRequestBody(RequestBody requestBody) returns RequestBodySchema|error {
private isolated function visitRequestBody(RequestBody requestBody) returns RequestBodySchema|OpenApiParsingError|error {
map<MediaType> content = requestBody.content;
string mediaType;
Schema schema;
Expand All @@ -231,7 +231,7 @@ class OpenApiSpecVisitor {
} else if schema is Reference {
outerBlockName = regexp:split(re `/`, schema.\$ref).pop();
} else {
return error("Schema should have a name for xml content type.", 'schema = schema);
return error OpenApiParsingError("Error while parsing the OpenAPI specification. The schema should have a name for xml content type.", cause = schema);
}
schema = {'type: OBJECT, properties: {[outerBlockName] : schema}};
return {
Expand Down

0 comments on commit 491600f

Please sign in to comment.