Skip to content

Commit

Permalink
fix: respect new lines in API description
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino committed Dec 17, 2024
1 parent 1dcc16f commit 49af870
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function generatePath(

if (!metadata.disablePost) {
result['post'] = {
description: contract.replaceAll('\n', '\n\n'),
description: contract,
tags: metadata.tags,
requestBody: {
content: {
Expand All @@ -94,7 +94,7 @@ export function generatePath(

if (!metadata.disableGet) {
result['get'] = {
description: contract.replaceAll('\n', '\n\n'),
description: contract,
tags: metadata.tags,
parameters: getParams,
responses: responses
Expand Down Expand Up @@ -158,6 +158,9 @@ const openapiCss = `
color: #444;
font-weight: 100;
}
.HttpOperation__Description p {
white-space: pre-line;
}
</style>
`;

Expand Down

0 comments on commit 49af870

Please sign in to comment.