diff --git a/sanic_openapi/doc.py b/sanic_openapi/doc.py index 3582426..b29d5a3 100644 --- a/sanic_openapi/doc.py +++ b/sanic_openapi/doc.py @@ -149,7 +149,6 @@ def definition(self): def serialize(self): return { - "type": "object", "$ref": "#/definitions/{}".format(self.object_name), **super().serialize(), } diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 10c6226..81a296c 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -95,7 +95,6 @@ class TestSchema: {"location": "body", "required": True, "content_type": "application/json"}, [ { - "type": "object", "required": True, "in": "body", "name": "body", @@ -127,7 +126,7 @@ def test(request): ( [TestSchema], {"content_type": "application/json"}, - {"200": {"schema": {"$ref": "#/definitions/TestSchema", "type": "object"}}}, + {"200": {"schema": {"$ref": "#/definitions/TestSchema"}}}, ), ], ) diff --git a/tests/test_fields.py b/tests/test_fields.py index 14479d5..971eff9 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -319,7 +319,7 @@ class TestSchema: (datetime, {"type": "string", "format": "date-time"}), (doc.DateTime, {"type": "string", "format": "date-time"}), (doc.DateTime(), {"type": "string", "format": "date-time"}), - (TestSchema, {"$ref": "#/definitions/TestSchema", "type": "object"}), + (TestSchema, {"$ref": "#/definitions/TestSchema"}), (dict, {"type": "object", "properties": {}}), ({"foo": "bar"}, {"type": "object", "properties": {"foo": {}}}), (list, {"type": "array", "items": []}),