Skip to content

Commit

Permalink
schema-type-coder fixes round when pointing to Github's OpenAPI descr…
Browse files Browse the repository at this point in the history
…iption
  • Loading branch information
pmcelhaney committed Aug 31, 2023
1 parent c4a20e6 commit 9cc8aff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/typescript-generator/schema-type-coder.js
Expand Up @@ -35,7 +35,7 @@ export class SchemaTypeCoder extends Coder {
data.required?.includes(name) || property.data.required;
const optionalFlag = isRequired ? "" : "?";

return `${name}${optionalFlag}: ${new SchemaTypeCoder(property).write(
return `"${name}"${optionalFlag}: ${new SchemaTypeCoder(property).write(
script,
)}`;
});
Expand Down Expand Up @@ -95,7 +95,9 @@ export class SchemaTypeCoder extends Coder {

writeEnum(script, requirement) {
return requirement.data
.map((item) => (typeof item === "string" ? `"${item}"` : item))
.map((item) =>
typeof item === "string" ? `"${item}"` : item === null ? "null" : item,
)
.join(" | ");
}

Expand Down

0 comments on commit 9cc8aff

Please sign in to comment.