Skip to content

Commit c5a1ad4

Browse files
✅ Update tests.
1 parent e4f5479 commit c5a1ad4

File tree

118 files changed

+461
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+461
-159
lines changed

tests/e2e/expected/dummy/dummy.yaml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ paths:
99
operationId: test_op
1010
responses:
1111
default:
12+
description: ''
1213
content:
1314
application/json:
1415
schema:
1516
$ref: '#/components/schemas/all'
16-
description: ''
17-
17+
headers:
18+
x-count:
19+
schema:
20+
type: integer
1821
parameters:
1922
- name: param1
2023
in: query
@@ -32,6 +35,28 @@ paths:
3235
required:
3336
- prop1
3437
required: true
38+
/inline_schema_properties/:
39+
get:
40+
operationId: inline_schema_properties
41+
responses:
42+
default:
43+
description: ''
44+
content:
45+
application/json:
46+
schema:
47+
type: object
48+
properties:
49+
prop1:
50+
type: object
51+
additionalProperties: false
52+
properties:
53+
prop2:
54+
type: string
55+
required:
56+
- prop2
57+
additionalProperties: false
58+
required:
59+
- prop1
3560
/custom-security:
3661
get:
3762
description: Operation with its own security defined
@@ -41,23 +66,21 @@ paths:
4166
content:
4267
application/json:
4368
schema:
44-
$ref: '#/components/schemas/all'
69+
type: array
70+
items:
71+
$ref: '#/components/schemas/all'
4572
description: ''
4673
security:
4774
- oauth:
4875
- read
4976
/insecure:
5077
get:
5178
description: Operation with no security requirements
52-
operationId: customSecurity
79+
operationId: insecure
5380
responses:
5481
default:
55-
content:
56-
application/json:
57-
schema:
58-
$ref: '#/components/schemas/all'
59-
description: ''
60-
security: []
82+
$ref: '#/components/responses/default'
83+
security: [ ]
6184

6285

6386
components:
@@ -181,6 +204,13 @@ components:
181204
http_digest:
182205
type: http
183206
scheme: digest
207+
responses:
208+
default:
209+
content:
210+
application/json:
211+
schema:
212+
$ref: '#/components/schemas/all'
213+
description: ''
184214

185215
security:
186216
- oauth-refresh:

tests/e2e/expected/dummy/gen/test_dummy/client.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
import typing_extensions as typing
1111
from lapidary.runtime import *
1212

13-
import test_dummy.components.schemas.all.schema
13+
import test_dummy.components.responses.default
1414
import test_dummy.components.schemas.schema1.schema
15+
import test_dummy.paths.u_lcustomu_jsecurity.get.responses.default
16+
import test_dummy.paths.u_linline_schema_propertiesu_l.get.responses.default
1517
import test_dummy.paths.u_ltestu_l.get.parameters.u_n.schema.schema
18+
import test_dummy.paths.u_ltestu_l.get.responses.default
1619

1720

1821
class ApiClient(ClientBase):
@@ -42,10 +45,23 @@ async def test_op(
4245
param1_q: typing.Annotated[test_dummy.components.schemas.schema1.schema.schema1, Query('param1', )],
4346
param2_q: typing.Annotated[test_dummy.paths.u_ltestu_l.get.parameters.u_n.schema.schema.schema, Query('param2', )],
4447
) -> typing.Annotated[
45-
Awaitable[test_dummy.components.schemas.all.schema.all],
48+
Awaitable[test_dummy.paths.u_ltestu_l.get.responses.default.Response],
4649
Responses({
4750
'default': {
48-
'application/json': test_dummy.components.schemas.all.schema.all,
51+
'application/json': test_dummy.paths.u_ltestu_l.get.responses.default.Response,
52+
},
53+
})
54+
]:
55+
pass
56+
57+
@get('/inline_schema_properties/')
58+
async def inline_schema_properties(
59+
self: typing.Self,
60+
) -> typing.Annotated[
61+
Awaitable[test_dummy.paths.u_linline_schema_propertiesu_l.get.responses.default.Response],
62+
Responses({
63+
'default': {
64+
'application/json': test_dummy.paths.u_linline_schema_propertiesu_l.get.responses.default.Response,
4965
},
5066
})
5167
]:
@@ -55,23 +71,23 @@ async def test_op(
5571
async def customSecurity(
5672
self: typing.Self,
5773
) -> typing.Annotated[
58-
Awaitable[test_dummy.components.schemas.all.schema.all],
74+
Awaitable[test_dummy.paths.u_lcustomu_jsecurity.get.responses.default.Response],
5975
Responses({
6076
'default': {
61-
'application/json': test_dummy.components.schemas.all.schema.all,
77+
'application/json': test_dummy.paths.u_lcustomu_jsecurity.get.responses.default.Response,
6278
},
6379
})
6480
]:
6581
pass
6682

6783
@get('/insecure', security=[])
68-
async def customSecurity(
84+
async def insecure(
6985
self: typing.Self,
7086
) -> typing.Annotated[
71-
Awaitable[test_dummy.components.schemas.all.schema.all],
87+
Awaitable[test_dummy.components.responses.default.Response],
7288
Responses({
7389
'default': {
74-
'application/json': test_dummy.components.schemas.all.schema.all,
90+
'application/json': test_dummy.components.responses.default.Response,
7591
},
7692
})
7793
]:
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is automatically @generated by Lapidary and should not be changed by hand.
2+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is automatically @generated by Lapidary and should not be changed by hand.
2+
3+
from __future__ import annotations
4+
5+
import typing_extensions as typing
6+
from lapidary.runtime import *
7+
import test_dummy.components.schemas.all.schema
8+
9+
10+
class Response(ResponseEnvelope):
11+
body: typing.Annotated[test_dummy.components.schemas.all.schema.all, ResponseBody()]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-

tests/e2e/expected/dummy/gen/test_dummy/components/schemas/all/properties/any/schema.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# This file is automatically @generated by Lapidary and should not be changed by hand.
22

3-
43
from __future__ import annotations
54

6-
import typing
7-
85
import lapidary.runtime
96
import pydantic
10-
import typing_extensions
11-
import lapidary.runtime
7+
import typing_extensions as typing
128

139

1410
class any(lapidary.runtime.ModelBase):

0 commit comments

Comments
 (0)