We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6ad47e commit 1bf0c27Copy full SHA for 1bf0c27
tests/test_apispec_converter.py
@@ -0,0 +1,21 @@
1
+from labthings.apispec.converter import ExtendedOpenAPIConverter
2
+
3
+from labthings import fields
4
5
6
+class TestField(fields.Field):
7
+ def _jsonschema_type_mapping(self):
8
+ """ """
9
+ return {"type": "string"}
10
11
12
+def test_jsonschema_type_mapping(spec):
13
+ converter = ExtendedOpenAPIConverter("3.0.2", lambda _: None, spec)
14
15
+ assert converter.jsonschema_type_mapping(TestField()) == {"type": "string"}
16
17
18
+def test_jsonschema_type_mapping_missing(spec):
19
20
21
+ assert converter.jsonschema_type_mapping(fields.Field()) == {}
0 commit comments