voluptuous-openapi 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: voluptuous-openapi
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Convert voluptuous schemas to OpenAPI Schema object
5
5
  Home-page: http://github.com/Shulyaka/voluptuous-openapi
6
6
  Author: Denis Shulyaka
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name="voluptuous-openapi",
5
- version="0.0.3",
5
+ version="0.0.4",
6
6
  description="Convert voluptuous schemas to OpenAPI Schema object",
7
7
  url="http://github.com/Shulyaka/voluptuous-openapi",
8
8
  author="Denis Shulyaka",
@@ -108,6 +108,10 @@ def test_dict():
108
108
  "additionalProperties": {"type": "string"},
109
109
  } == convert(vol.Schema({"x": int, str: str}))
110
110
 
111
+ assert {"type": "object", "properties": {}, "required": []} == convert(
112
+ vol.Schema({})
113
+ )
114
+
111
115
 
112
116
  def test_tuple():
113
117
  assert {"type": "array", "items": {"type": "string"}} == convert(vol.Schema(tuple))
@@ -91,7 +91,7 @@ def convert(schema: Any, *, custom_serializer: Callable | None = None) -> dict:
91
91
  required.append(str(pkey))
92
92
 
93
93
  val = {"type": "object"}
94
- if properties:
94
+ if properties or not additional_properties:
95
95
  val["properties"] = properties
96
96
  val["required"] = required
97
97
  if additional_properties:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: voluptuous-openapi
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Convert voluptuous schemas to OpenAPI Schema object
5
5
  Home-page: http://github.com/Shulyaka/voluptuous-openapi
6
6
  Author: Denis Shulyaka