Skip to content

Commit 504af8a

Browse files
committed
replaced json-refs with swagger-client
1 parent 5e2a025 commit 504af8a

18 files changed

+523
-379
lines changed

dist/rapidoc-min.js

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

dist/rapidoc-min.js.gz

10.9 KB
Binary file not shown.

dist/rapidoc-min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.map.gz

7 Bytes
Binary file not shown.

dist/report.html

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

docs/examples/multi-file.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/examples/temp.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!doctype html>
2+
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
6+
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,700i,800,800i,900,900i&display=swap" rel="stylesheet">
7+
<script type="text/javascript" src="../rapidoc-min.js"></script>
8+
<style>
9+
rapi-doc {
10+
width: 100%;
11+
}
12+
13+
rapi-doc {
14+
--blue: hotpink;
15+
--font-size-regular: 11px;
16+
}
17+
18+
/* Here */
19+
h2 {
20+
font-weight: bold !important;
21+
color: red !important;
22+
}
23+
24+
/* Here */
25+
.sub-title {
26+
font-weight: bold !important;
27+
}
28+
</style>
29+
</head>
30+
31+
<body>
32+
<rapi-doc spec-url="https://petstore.swagger.io/v2/swagger.json" allow-spec-file-load="false" allow-spec-url-load="false" layout="row"
33+
schema-style="table" schema-description-expanded="true" heading-text="API" schema-expand-level="1"
34+
regular-font="'Montserrat', sans-serif">
35+
</rapi-doc>
36+
</body>
37+
38+
</html>

docs/rapidoc-min.js

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

docs/specs/external-refs.yaml

Lines changed: 59 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,61 @@
11
openapi: 3.0.2
2-
servers:
3-
- url: https//example/system
2+
info:
3+
version: '1.0'
4+
title: External refs (json-pointers)
5+
description: >
6+
Following OpenAPI spec demonstrate how to use external reference
7+
8+
9+
below is the main spec, but the schema used in the response is defined in a sepaerate file named - schema.yaml
10+
11+
```
12+
13+
openapi: 3.0.0
14+
info:
15+
title: Dynamic Form Params
16+
version: 1.0.0
17+
paths:
18+
/user1:
19+
get:
20+
description: List User
21+
summary: List User
22+
responses:
23+
'200':
24+
description: The response
25+
content:
26+
application/json:
27+
schema:
28+
$ref:'./schema.yaml#/components/schemas/user' <<< relative to html where rapidoc element is defined
29+
```
30+
31+
schema.yaml
32+
33+
```
34+
35+
openapi: 3.0.2
36+
info:
37+
title: Partial spec for schema
38+
version: 1.0.0
39+
components:
40+
schemas:
41+
user:
42+
properties:
43+
id:
44+
type: integer
45+
name:
46+
type: string
47+
```
48+
49+
450
paths:
5-
/sample/login:
6-
post:
7-
summary: Login
8-
operationId: userLogin
9-
description: Login.
10-
parameters:
11-
- $ref: '../../specs/partial.json#/components/parameters/accept' # This path is relative to the html which shows the spec (not to the spec itself)
12-
- $ref: '#/components/parameters/acceptLanguageHeader'
13-
- $ref: '#/components/parameters/contentType'
14-
# Components
15-
components:
16-
parameters:
17-
acceptLanguageHeader:
18-
name: Accept-Language
19-
in: header
20-
description: Language locale accepted by client (used for locale specific fields in resource representation and in error responses).
21-
required: true
22-
schema:
23-
type: string
24-
enum: [en-US, es-ES, fr-FR]
25-
contentType:
26-
name: Content-Type
27-
in: header
28-
description: Media type sent by the client
29-
required: true
30-
schema:
31-
type: string
32-
enum: [application/xml, application/json]
51+
/user1:
52+
get:
53+
description: List User
54+
summary: List User
55+
responses:
56+
'200':
57+
description: The response
58+
content:
59+
application/json:
60+
schema:
61+
$ref: '../../specs/partial.yaml#/components/schemas/user'

docs/specs/multi-file-index.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)