File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
sanic_ext/extensions/openapi Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ def __init__(
352
352
variables : Optional [Dict [str , Any ]] = None ,
353
353
):
354
354
super ().__init__ (
355
- url = url , description = description , variables = variables or []
355
+ url = url , description = description , variables = variables or {}
356
356
)
357
357
358
358
Original file line number Diff line number Diff line change 2
2
3
3
import pytest
4
4
5
+ from sanic_ext .extensions .openapi .definitions import Server
5
6
from sanic_ext .extensions .openapi .types import Definition
6
7
7
8
@@ -45,3 +46,11 @@ def test_serialize_no_nullable(Thing):
45
46
assert serialized ["name" ] == "ok"
46
47
assert "foo" not in serialized
47
48
assert "bar" not in serialized
49
+
50
+
51
+ def test_server_definitions_defaults ():
52
+ assert Server (url = "url" ).fields == {
53
+ "url" : "url" ,
54
+ "description" : None ,
55
+ "variables" : {},
56
+ }
You can’t perform that action at this time.
0 commit comments