Skip to content

Commit

Permalink
Address more review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaRanasinghe committed Jul 12, 2024
1 parent aa2c3ac commit 484cc04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/spec/sanitations.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import ballerina/io;
import ballerina/lang.regexp;
import ballerina/mime;

type Specification record {
map<Path> paths;
Expand Down Expand Up @@ -62,7 +63,6 @@ type Components record {
};

const SPEC_PATH = "openapi.json";
const CONTENT_TYPE_JSON = "application/json";
final regexp:RegExp MALFORMED_TITLE_REGEX = re `\w+[\.\s]\w+.*`;

public function main() returns error? {
Expand All @@ -89,7 +89,7 @@ function sanitizeResponseSchemaNames(Specification spec) returns Specification|e
}
foreach [string, ResponseCode] [_, item] in responses.entries() {
map<ResponseHeader> content = item.content ?: {};
ResponseHeader app = content[CONTENT_TYPE_JSON] ?: {};
ResponseHeader app = content[mime:APPLICATION_JSON] ?: {};
ResponseSchema schema = app.schema ?: {};
string? title = schema.title;
if title !is string {
Expand Down

0 comments on commit 484cc04

Please sign in to comment.