Skip to content

Commit e34f113

Browse files
committed
Remove obsolete configuration files and restructure OpenAPI documentation
1 parent 1483ac5 commit e34f113

28 files changed

+399
-1041
lines changed

.redocly.yaml

-14
This file was deleted.

docs/.redocly.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://redoc.ly/docs/cli/configuration/ for more information.
2+
extends:
3+
- recommended
4+
apis:
5+
core@v1:
6+
root: ./openapi/openapi.yaml
7+
rules:
8+
no-ambiguous-paths: error
9+
theme:
10+
openapi:
11+
hideLogo: false
12+
decorators:
13+
remove-x-internal: on
14+
rules:
15+
no-unused-components: error
16+
operation-singular-tag: warn
17+
boolean-parameter-prefixes:
18+
severity: error
19+
prefixes: ["can", "is", "has"]
20+
theme:
21+
openapi:
22+
schemaExpansionLevel: 2
23+
generateCodeSamples:
24+
languages:
25+
- lang: curl
26+
- lang: Python

docs/index.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<html>
2+
3+
<head>
4+
<!-- Load the latest Swagger UI code and style from npm using unpkg.com -->
5+
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
6+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css" />
7+
<title>My New API</title>
8+
</head>
9+
10+
<body>
11+
<div id="swagger-ui"></div> <!-- Div to hold the UI component -->
12+
<script>
13+
window.onload = function () {
14+
// Begin Swagger UI call region
15+
const ui = SwaggerUIBundle({
16+
url: 'https://github.com/dan5e3s6ares/nft/blob/docs/docs/openapi.yaml',
17+
dom_id: '#swagger-ui',
18+
deepLinking: true,
19+
presets: [
20+
SwaggerUIBundle.presets.apis,
21+
SwaggerUIBundle.SwaggerUIStandalonePreset
22+
],
23+
plugins: [
24+
SwaggerUIBundle.plugins.DownloadUrl
25+
],
26+
})
27+
window.ui = ui
28+
}
29+
</script>
30+
</body>
31+
32+
</html>

docs/openapi.yaml

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
openapi: 3.0.2
2+
info:
3+
version: 1.0.0
4+
title: NFT Python Floripa
5+
termsOfService: https://example.com/terms/
6+
contact:
7+
8+
url: http://example.com/contact
9+
license:
10+
name: Apache 2.0
11+
url: http://www.apache.org/licenses/LICENSE-2.0.html
12+
x-logo:
13+
url: https://redocly.github.io/openapi-template/logo.png
14+
description: |
15+
NFT API Documentation.
16+
servers:
17+
- url: https://pop.cloudman.pro
18+
tags:
19+
- name: Cadastro
20+
description: Example echo operations
21+
- name: Certificado
22+
description: Operations about user
23+
externalDocs:
24+
description: Find out how to create a GitHub repo for your OpenAPI definition.
25+
url: https://github.com/Rebilly/generator-openapi-repo
26+
paths:
27+
/pop/Auth-pop:
28+
post:
29+
operationId: create_user
30+
tags:
31+
- Cadastro
32+
summary: Create a new user
33+
deprecated: false
34+
description: Create a new user
35+
requestBody:
36+
description: User object that needs to be added to the system
37+
content:
38+
application/json:
39+
schema:
40+
$ref: '#/components/schemas/CreateUser'
41+
required: true
42+
responses:
43+
'200':
44+
description: Success
45+
content:
46+
application/json:
47+
schema:
48+
$ref: '#/components/schemas/User'
49+
application/xml:
50+
schema:
51+
$ref: '#/components/schemas/User'
52+
'400':
53+
description: Invalid user supplied
54+
'409':
55+
description: User already exists
56+
/pop/OrgAdmin-pop:
57+
post:
58+
operationId: create_certificate
59+
tags:
60+
- Certificado
61+
summary: Create a new certificate
62+
deprecated: false
63+
description: Create a new certificate
64+
requestBody:
65+
description: Certificate object that needs to be added to the system
66+
content:
67+
application/json:
68+
schema:
69+
$ref: '#/components/schemas/CreateCertificate'
70+
required: true
71+
responses:
72+
'200':
73+
description: Success
74+
content:
75+
application/json:
76+
schema:
77+
$ref: '#/components/schemas/CertificateCreated'
78+
application/xml:
79+
schema:
80+
$ref: '#/components/schemas/CertificateCreated'
81+
'409':
82+
description: Item não encontrado na DynamoDB
83+
components:
84+
securitySchemes:
85+
main_auth:
86+
type: oauth2
87+
flows:
88+
implicit:
89+
authorizationUrl: http://example.com/api/oauth/dialog
90+
scopes:
91+
read:users: read users info
92+
write:users: modify or remove users
93+
api_key:
94+
type: apiKey
95+
in: header
96+
name: api_key
97+
basic_auth:
98+
type: http
99+
scheme: basic
100+
schemas:
101+
User:
102+
properties:
103+
name:
104+
description: User Name
105+
type: string
106+
minLength: 4
107+
example: John Smith
108+
Email:
109+
properties:
110+
email:
111+
description: User email address
112+
type: string
113+
format: test
114+
115+
CreateUser:
116+
type: object
117+
title: Create User
118+
description: Create a new user
119+
required:
120+
- name
121+
- email
122+
- action
123+
- otp
124+
allOf:
125+
- $ref: '#/components/schemas/User'
126+
- $ref: '#/components/schemas/Email'
127+
properties:
128+
action:
129+
type: string
130+
enum:
131+
- verify
132+
- register
133+
- process-link
134+
format: test
135+
description: Action to be performed
136+
otp:
137+
type: string
138+
example: '123456'
139+
format: test
140+
description: OTP code
141+
Certificate:
142+
properties:
143+
orgName:
144+
description: Organization name
145+
type: string
146+
format: test
147+
example: Example Inc.
148+
eventName:
149+
description: Event name
150+
type: string
151+
format: test
152+
example: Example Event
153+
CreateCertificate:
154+
type: object
155+
title: Create User
156+
description: Create a new user
157+
required:
158+
- orgName
159+
- eventName
160+
allOf:
161+
- $ref: '#/components/schemas/Certificate'
162+
properties:
163+
action:
164+
type: string
165+
enum:
166+
- StartCreateCerts
167+
format: text
168+
description: Action to be performed
169+
CertificateCreated:
170+
properties:
171+
attendeeCounter:
172+
description: Number of attendees
173+
type: integer
174+
format: int32
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
properties:
2+
orgName:
3+
description: Organization name
4+
type: string
5+
format: test
6+
example: "Example Inc."
7+
eventName:
8+
description: Event name
9+
type: string
10+
format: test
11+
example: "Example Event"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
properties:
2+
email:
3+
description: User email address
4+
type: string
5+
format: test
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
properties:
2+
name:
3+
description: User Name
4+
type: string
5+
minLength: 4
6+
example: John Smith

docs/openapi/openapi.yaml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
openapi: 3.0.2
2+
info:
3+
version: 1.0.0
4+
title: NFT Python Floripa
5+
termsOfService: "https://example.com/terms/"
6+
contact:
7+
8+
url: "http://example.com/contact"
9+
license:
10+
name: Apache 2.0
11+
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
12+
x-logo:
13+
url: "https://redocly.github.io/openapi-template/logo.png"
14+
description: >
15+
NFT API Documentation.
16+
externalDocs:
17+
description: Find out how to create a GitHub repo for your OpenAPI definition.
18+
url: "https://github.com/Rebilly/generator-openapi-repo"
19+
tags:
20+
- name: Cadastro
21+
description: Example echo operations
22+
- name: Certificado
23+
description: Operations about user
24+
servers:
25+
- url: "https://pop.cloudman.pro"
26+
paths:
27+
/pop/Auth-pop:
28+
post:
29+
operationId: create_user
30+
tags:
31+
- Cadastro
32+
summary: Create a new user
33+
deprecated: false
34+
description: Create a new user
35+
requestBody:
36+
description: User object that needs to be added to the system
37+
content:
38+
application/json:
39+
schema:
40+
$ref: ./requests/CreateUser.yaml
41+
required: true
42+
responses:
43+
"200":
44+
description: Success
45+
content:
46+
application/json:
47+
schema:
48+
$ref: ./components/schemas/User.yaml
49+
application/xml:
50+
schema:
51+
$ref: ./components/schemas/User.yaml
52+
"400":
53+
description: Invalid user supplied
54+
"409":
55+
description: User already exists
56+
/pop/OrgAdmin-pop:
57+
post:
58+
operationId: create_certificate
59+
tags:
60+
- Certificado
61+
summary: Create a new certificate
62+
deprecated: false
63+
description: Create a new certificate
64+
requestBody:
65+
description: Certificate object that needs to be added to the system
66+
content:
67+
application/json:
68+
schema:
69+
$ref: ./requests/CreateCertificate.yaml
70+
required: true
71+
responses:
72+
"200":
73+
description: Success
74+
content:
75+
application/json:
76+
schema:
77+
$ref: ./responses/CertificateCreated.yaml
78+
application/xml:
79+
schema:
80+
$ref: ./responses/CertificateCreated.yaml
81+
"409":
82+
description: Item não encontrado na DynamoDB
83+
components:
84+
securitySchemes:
85+
main_auth:
86+
type: oauth2
87+
flows:
88+
implicit:
89+
authorizationUrl: "http://example.com/api/oauth/dialog"
90+
scopes:
91+
"read:users": read users info
92+
"write:users": modify or remove users
93+
api_key:
94+
type: apiKey
95+
in: header
96+
name: api_key
97+
basic_auth:
98+
type: http
99+
scheme: basic
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type: object
2+
title: Create User
3+
description: Create a new user
4+
required:
5+
- orgName
6+
- eventName
7+
allOf:
8+
- $ref: ../components/schemas/Certificate.yaml
9+
properties:
10+
action:
11+
type: string
12+
enum:
13+
- StartCreateCerts
14+
format: text
15+
description: Action to be performed

0 commit comments

Comments
 (0)