PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: s-knibbs/dataclasses-jsonschema (python)
Issue: Generated JSON schema are causing Swagger validation warnings
The JSON references currently being generated aren't correct, instead of this:
```json
{"$ref": "#/definitions/Point", "type": "object"}
```
should be this:
```json
{"$ref": "#/definitions/Point"}
```
Pull request description: Fixes #8: Generate valid $ref objects

Patch:
diff --git a/dataclasses_jsonschema/__init__.py b/dataclasses_jsonschema/__init__.py
index baae129..e5979bc 100644
--- a/dataclasses_jsonschema/__init__.py
+++ b/dataclasses_jsonschema/__init__.py
@@ -232,10 +232,7 @@ class JsonSchemaMixin:
         required = True
         field_type_name = cls._get_field_type_name(field_type)
         if cls._is_json_schema_subclass(field_type):
-            field_schema = {
-                'type': 'object',
-                '$ref': '#/definitions/{}'.format(field_type_name)
-            }
+            field_schema = {'$ref': '#/definitions/{}'.format(field_type_name)}
         else:
             # If is optional[...]
             if is_optional(field_type):


Test patch:
diff --git a/tests/test_all.py b/tests/test_all.py
index 6179c53..6f50eef 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -12,7 +12,7 @@ FOO_SCHEMA = {
     'description': 'A foo that foos',
     'properties': {
         'a': {'format': 'date-time', 'type': 'string'},
-        'b': {'items': {'$ref': '#/definitions/Point', 'type': 'object'}, 'type': 'array'},
+        'b': {'items': {'$ref': '#/definitions/Point'}, 'type': 'array'},
         'c': {'additionalProperties': {'format': 'integer', 'type': 'number'}, 'type': 'object'},
         'd': {'type': 'string', 'enum': ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']},
         'e': {'type': 'string', 'minLength': 5, 'maxLength': 8}},
@@ -35,7 +35,7 @@ RECURSIVE_SCHEMA = {
     "description": Recursive.__doc__,
     "properties": {
         'a': {'type': 'string'},
-        'b': {'type': 'object', '$ref': '#/definitions/Recursive'}
+        'b': {'$ref': '#/definitions/Recursive'}
     },
     'type': 'object',
     'required': ['a']