File tree Expand file tree Collapse file tree 3 files changed +82
-2
lines changed
Expand file tree Collapse file tree 3 files changed +82
-2
lines changed Original file line number Diff line number Diff line change 11openapi : 3.0.2
22info :
3- title : subschemas
3+ title : dummy
44 description : ' test generating /components/schemas with sub-schemas'
55 version : 1.0.0
66paths :
@@ -32,6 +32,33 @@ paths:
3232 required :
3333 - prop1
3434 required : true
35+ /custom-security :
36+ get :
37+ description : Operation with its own security defined
38+ operationId : customSecurity
39+ responses :
40+ default :
41+ content :
42+ application/json :
43+ schema :
44+ $ref : ' #/components/schemas/all'
45+ description : ' '
46+ security :
47+ - oauth :
48+ - read
49+ /insecure :
50+ get :
51+ description : Operation with no security requirements
52+ operationId : customSecurity
53+ responses :
54+ default :
55+ content :
56+ application/json :
57+ schema :
58+ $ref : ' #/components/schemas/all'
59+ description : ' '
60+ security : []
61+
3562
3663components :
3764 schemas :
Original file line number Diff line number Diff line change @@ -50,3 +50,29 @@ async def test_op(
5050 })
5151 ]:
5252 pass
53+
54+ @get ('/custom-security' , security = [{'oauth' : ['read' ]}])
55+ async def customSecurity (
56+ self : typing .Self ,
57+ ) -> typing .Annotated [
58+ Awaitable [test_dummy .components .schemas .all .schema .all ],
59+ Responses ({
60+ 'default' : {
61+ 'application/json' : test_dummy .components .schemas .all .schema .all ,
62+ },
63+ })
64+ ]:
65+ pass
66+
67+ @get ('/insecure' , security = [])
68+ async def customSecurity (
69+ self : typing .Self ,
70+ ) -> typing .Annotated [
71+ Awaitable [test_dummy .components .schemas .all .schema .all ],
72+ Responses ({
73+ 'default' : {
74+ 'application/json' : test_dummy .components .schemas .all .schema .all ,
75+ },
76+ })
77+ ]:
78+ pass
Original file line number Diff line number Diff line change 11openapi : 3.0.2
22info :
3- title : subschemas
3+ title : dummy
44 description : ' test generating /components/schemas with sub-schemas'
55 version : 1.0.0
66paths :
@@ -32,6 +32,33 @@ paths:
3232 required :
3333 - prop1
3434 required : true
35+ /custom-security :
36+ get :
37+ description : Operation with its own security defined
38+ operationId : customSecurity
39+ responses :
40+ default :
41+ content :
42+ application/json :
43+ schema :
44+ $ref : ' #/components/schemas/all'
45+ description : ' '
46+ security :
47+ - oauth :
48+ - read
49+ /insecure :
50+ get :
51+ description : Operation with no security requirements
52+ operationId : customSecurity
53+ responses :
54+ default :
55+ content :
56+ application/json :
57+ schema :
58+ $ref : ' #/components/schemas/all'
59+ description : ' '
60+ security : []
61+
3562
3663components :
3764 schemas :
You can’t perform that action at this time.
0 commit comments