Skip to content

Commit 3b5c37a

Browse files
committed
fixed runtime errro when summary and description both are missing
1 parent 0fbc393 commit 3b5c37a

File tree

9 files changed

+34
-78
lines changed

9 files changed

+34
-78
lines changed

.yarnrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
yarn-path ".yarn/releases/yarn-1.22.10.cjs"

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarnPath: .yarn/releases/yarn-2.4.0.cjs

dist/rapidoc-min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.gz

8 Bytes
Binary file not shown.

dist/report.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/rapidoc-min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/specs/temp.yaml

Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,22 @@
1-
openapi: 3.0.0
1+
openapi: 3.0.3
22
info:
3-
version: 1.119.0
4-
title: Default value error
3+
title: Test
4+
description: test
5+
version: 1.0.0
6+
servers:
7+
- url: 'http://localhost:9000'
8+
description: Local server
59
paths:
6-
/api/v1/accounts/dailyBalances:
10+
/test:
711
get:
8-
tags:
9-
- Accounts
10-
summary: Get daily balances
11-
operationId: getDailyBalances
1212
parameters:
13-
- name: withProjection
14-
in: query
15-
description: Whether....
16-
required: false
17-
schema:
18-
type: boolean
19-
default: true
20-
- name: page
21-
in: query
22-
description: Result page that you want to retrieve.
23-
required: false
24-
schema:
25-
type: integer
26-
minimum: 1
27-
default: 1
28-
- name: perPage
29-
in: query
30-
description: "Maximum number of records per page. By default it's 20. Can be at
31-
most 500. NOTE: Due to its validation and visualization, the swagger
32-
frontend might show very low performance, or even crashes, when a
33-
service responds with a lot of data. It is recommended to use a HTTP
34-
client like Postman or DHC instead of our swagger frontend for
35-
service calls with large page sizes."
36-
required: false
13+
- name: env
14+
in: path
3715
schema:
38-
type: integer
39-
minimum: 1
40-
maximum: 500
41-
default: 20
42-
example: 50
43-
- name: order
44-
in: query
45-
description: Determines the order of the results.
46-
required: false
47-
explode: true
48-
schema:
49-
type: array
50-
items:
51-
type: string
52-
default: date,ASC
16+
type: string
17+
enum: [prod, dev]
18+
default: production
19+
example: qa
5320
responses:
54-
"200":
55-
description: List of requested daily balances
56-
content:
57-
"*/*":
58-
schema:
59-
$ref: "#/components/schemas/DailyBalanceList"
60-
servers:
61-
- url: /
62-
components:
63-
schemas:
64-
DailyBalanceList:
65-
type: object
66-
properties:
67-
latestCommonBalanceTimestamp:
68-
type: string
69-
example: 2018-01-01 00:00:00.000
70-
description: The latestCommonBalanceTimestamp is the latest timestamp at which
71-
all regarded accounts have been up to date.
72-
description: Contains a list of daily balances
21+
'200':
22+
description: 'ok'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rapidoc",
3-
"version": "8.4.6",
3+
"version": "8.4.7",
44
"description": "RapiDoc - Open API spec viewer with built in console",
55
"author": "Mrinmoy Majumdar <[email protected]>",
66
"repository": {

src/utils/spec-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function groupByTags(openApiSpec, sortTags = false, sortEndpointsBy) {
322322
}
323323

324324
// Generate a short summary which is broken
325-
let shortSummary = (fullPath.summary || fullPath.description || fullPath.path).trim();
325+
let shortSummary = (fullPath.summary || fullPath.description || `${methodName.toUpperCase()} ${path}`).trim();
326326
if (shortSummary.length > 100) {
327327
shortSummary = shortSummary.split('/\r?\n|[.]/')[0]; // take the first line (period or carriage return)
328328
}

0 commit comments

Comments
 (0)