Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit a89b1f9

Browse files
committed
Add example with security to test project
1 parent ee09026 commit a89b1f9

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

test/project/openapi.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,20 @@ components:
185185
properties:
186186
data:
187187
$ref: '#/components/schemas/data'
188-
securitySchemes: {}
188+
securitySchemes:
189+
bearerAuth:
190+
type: oauth2
191+
flows:
192+
implicit:
193+
authorizationUrl: 'https://example.com/oauth/authorize'
194+
scopes:
195+
read: Grants read access
196+
write: Grants write access
197+
admin: Grants access to admin operations
189198
info:
190199
title: ''
191200
description: ''
192-
version: 96d3d004-1a24-4384-9df7-1e7416393223
201+
version: 1a08e671-e4b5-4d13-babe-a00c86ec8b5d
193202
paths:
194203
/create:
195204
post:
@@ -239,3 +248,7 @@ paths:
239248
application/json:
240249
schema:
241250
$ref: '#/components/schemas/ErrorResponse'
251+
security:
252+
- bearerAuth:
253+
- read
254+
- write

test/project/serverless.doc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
documentation:
2+
components:
3+
securitySchemes:
4+
bearerAuth:
5+
type: oauth2
6+
flows:
7+
implicit:
8+
authorizationUrl: https://example.com/oauth/authorize
9+
scopes:
10+
read: Grants read access
11+
write: Grants write access
12+
admin: Grants access to admin operations
13+
security:
14+
- bearerAuth:
15+
- read
16+
- write
217
models:
318
- name: ErrorResponse
419
description: This is an error

0 commit comments

Comments
 (0)