{"receipt_id":"agent1-1","seq":1,"branch_id":"agent1","kind":"command","cmd":"git ls-files -z","path":null,"exit_code":0,"stdout_tail":".gitignore\u0000.travis.yml\u0000LICENSE\u0000README.rst\u0000dataclasses_jsonschema/__init__.py\u0000dataclasses_jsonschema/apispec.py\u0000dataclasses_jsonschema/field_types.py\u0000dataclasses_jsonschema/py.typed\u0000dataclasses_jsonschema/type_defs.py\u0000setup.cfg\u0000setup.py\u0000test_issue.py\u0000tests/__init__.py\u0000tests/conftest.py\u0000tests/test_apispec_plugin.py\u0000tests/test_core.py\u0000tox.ini\u0000","stderr_tail":"","stdout_sha256":"6d5ce62947e880799ceb541051b349f3de4743b73ec3da34140ee95cb39816b3","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-1.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T19:36:22.674140Z","duration_s":0.004446,"timed_out":false,"image_before":"4793f385-64a7-4d04-ac2a-3d29732e5f0b","image_after":"4cdbba5d-6585-4bcc-89d9-4923e79626b1","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-2","seq":2,"branch_id":"agent1","kind":"command","cmd":"grep -n \"test_from_json_to_json\" tests/test_core.py","path":null,"exit_code":0,"stdout_tail":"222:def test_from_json_to_json():\n","stderr_tail":"","stdout_sha256":"d292d3ccef8aae54489e494dce1b60a5d333c3d4849c6a5b39a0ba7463387b3f","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-2.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T19:36:33.924084Z","duration_s":0.002928,"timed_out":false,"image_before":"4cdbba5d-6585-4bcc-89d9-4923e79626b1","image_after":"8531ba2e-52af-440a-9722-2f97978ca33a","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-3","seq":3,"branch_id":"agent1","kind":"write","cmd":"/opt/receipts-a060393b8c1247ea9fb72fb17cb96bf8/bin/busybox sh -c 'mkdir -p /dataclasses-jsonschema/dataclasses_jsonschema && cp /opt/receipts-a060393b8c1247ea9fb72fb17cb96bf8/incoming/f9056d9788e2d23f7eb8628f5c3e26e2247944d0aa4efb257f3178ceedf686ab /dataclasses-jsonschema/dataclasses_jsonschema/__init__.py'","path":"dataclasses_jsonschema/__init__.py","exit_code":0,"stdout_tail":"","stderr_tail":"","stdout_sha256":"f9056d9788e2d23f7eb8628f5c3e26e2247944d0aa4efb257f3178ceedf686ab","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-3.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T19:36:47.136185Z","duration_s":0.005136,"timed_out":false,"image_before":"8531ba2e-52af-440a-9722-2f97978ca33a","image_after":"cf514ad3-20af-4edb-9a8e-f93eef768250","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-4","seq":4,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-97a1eae3a3c3453fa493145e46b80656/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-97a1eae3a3c3453fa493145e46b80656/receipts_pytest.py tests/test_core.py::test_from_json_to_json -v -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-4.xml","path":null,"exit_code":0,"stdout_tail":"============================= test session starts ==============================\nplatform linux -- Python 3.7.17, pytest-7.4.4, pluggy-1.2.0 -- /usr/local/bin/python\nrootdir: /dataclasses-jsonschema\ncollecting ... collected 1 item\n\ntests/test_core.py::test_from_json_to_json PASSED                        [100%]\n\n==================================== PASSES ====================================\n------------ generated xml file: /opt/receipts/reports/agent1-4.xml ------------\n=========================== short test summary info ============================\nPASSED tests/test_core.py::test_from_json_to_json\n============================== 1 passed in 0.07s ===============================\n","stderr_tail":"","stdout_sha256":"68476ac68e79f9284943b522d39f32cd55845217aea7a04cca9cd4f7ebcdce6d","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-4.log","tree_digest":"d04c677ef71e67c487e174896147ec4d86b1f201ae538e45a96ba204e0ce1692","tree_download_s":2.0066924169659615,"started_at":"2026-10-03T19:36:50.096649Z","duration_s":0.277865,"timed_out":false,"image_before":"cf514ad3-20af-4edb-9a8e-f93eef768250","image_after":"63401c10-2ee9-4cde-99ad-af5afbec692f","junit":{"passed":["tests/test_core.py::test_from_json_to_json"],"failed":[],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-5","seq":5,"branch_id":"agent1","kind":"command","cmd":"/opt/receipts-e545769109bb483e93e1660bfb720aac/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-e545769109bb483e93e1660bfb720aac/receipts_pytest.py tests/test_core.py --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-5.xml","path":null,"exit_code":0,"stdout_tail":"============================= test session starts ==============================\ncollected 29 items\n\ntests/test_core.py .............................                         [100%]\n\n==================================== PASSES ====================================\n------------ generated xml file: /opt/receipts/reports/agent1-5.xml ------------\n=========================== short test summary info ============================\nPASSED tests/test_core.py::test_field_with_default_factory\nPASSED tests/test_core.py::test_field_with_default_dataclass\nPASSED tests/test_core.py::test_embeddable_json_schema\nPASSED tests/test_core.py::test_json_schema\nPASSED tests/test_core.py::test_serialise_deserialise\nPASSED tests/test_core.py::test_from_json_to_json\nPASSED tests/test_core.py::test_invalid_data\nPASSED tests/test_core.py::test_newtype_field_validation\nPASSED tests/test_core.py::test_recursive_data\nPASSED tests/test_core.py::test_recursive_validation\nPASSED tests/test_core.py::test_non_string_keys\nPASSED tests/test_core.py::test_type_union_schema\nPASSED tests/test_core.py::test_type_union_serialise\nPASSED tests/test_core.py::test_type_union_deserialise\nPASSED tests/test_core.py::test_default_values\nPASSED tests/test_core.py::test_default_factory\nPASSED tests/test_core.py::test_read_only_field\nPASSED tests/test_core.py::test_read_only_field_no_default\nPASSED tests/test_core.py::test_field_types\nPASSED tests/test_core.py::test_field_metadata\nPASSED tests/test_core.py::test_final_field\nPASSED tests/test_core.py::test_literal_types\nPASSED tests/test_core.py::test_from_object\nPASSED tests/test_core.py::test_serialise_deserialise_opaque_data\nPASSED tests/test_core.py::test_inherited_schema\nPASSED tests/test_core.py::test_optional_union\nPASSED tests/test_core.py::test_nullable_field\nPASSED tests/test_core.py::test_underscore_fields\nPASSED tests/test_core.py::test_discriminators\n============================== 29 passed in 0.13s ==============================\n","stderr_tail":"","stdout_sha256":"08a269d2f5d386593128b3e8f0a34f8fa1a304f6e9d12eb4e0003af102a04985","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-5.log","tree_digest":"d04c677ef71e67c487e174896147ec4d86b1f201ae538e45a96ba204e0ce1692","tree_download_s":2.652533082989976,"started_at":"2026-10-03T19:36:55.723232Z","duration_s":0.33767,"timed_out":false,"image_before":"63401c10-2ee9-4cde-99ad-af5afbec692f","image_after":"330612dc-e331-4a75-af11-f990e0417684","junit":{"passed":["tests/test_core.py::test_field_with_default_factory","tests/test_core.py::test_field_with_default_dataclass","tests/test_core.py::test_embeddable_json_schema","tests/test_core.py::test_json_schema","tests/test_core.py::test_serialise_deserialise","tests/test_core.py::test_from_json_to_json","tests/test_core.py::test_invalid_data","tests/test_core.py::test_newtype_field_validation","tests/test_core.py::test_recursive_data","tests/test_core.py::test_recursive_validation","tests/test_core.py::test_non_string_keys","tests/test_core.py::test_type_union_schema","tests/test_core.py::test_type_union_serialise","tests/test_core.py::test_type_union_deserialise","tests/test_core.py::test_default_values","tests/test_core.py::test_default_factory","tests/test_core.py::test_read_only_field","tests/test_core.py::test_read_only_field_no_default","tests/test_core.py::test_field_types","tests/test_core.py::test_field_metadata","tests/test_core.py::test_final_field","tests/test_core.py::test_literal_types","tests/test_core.py::test_from_object","tests/test_core.py::test_serialise_deserialise_opaque_data","tests/test_core.py::test_inherited_schema","tests/test_core.py::test_optional_union","tests/test_core.py::test_nullable_field","tests/test_core.py::test_underscore_fields","tests/test_core.py::test_discriminators"],"failed":[],"errors":[],"skipped":[],"collection_errors":[],"failure_text":{}},"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-6","seq":6,"branch_id":"agent1","kind":"write","cmd":"/opt/receipts-9fcf0eabff054898bd98eaad47fcc7c5/bin/busybox sh -c 'mkdir -p /tmp && cp /opt/receipts-9fcf0eabff054898bd98eaad47fcc7c5/incoming/ea57ff280ec5e9618bf4b9825cb6346a7f4a449e7ab686403fee0d8f5519ab1c /tmp/verify_methods.py'","path":"/tmp/verify_methods.py","exit_code":0,"stdout_tail":"","stderr_tail":"","stdout_sha256":"ea57ff280ec5e9618bf4b9825cb6346a7f4a449e7ab686403fee0d8f5519ab1c","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-6.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T19:37:04.440245Z","duration_s":0.005214,"timed_out":false,"image_before":"330612dc-e331-4a75-af11-f990e0417684","image_after":"af83156a-995f-4472-a517-914afc302aae","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-7","seq":7,"branch_id":"agent1","kind":"command","cmd":"python /tmp/verify_methods.py","path":null,"exit_code":0,"stdout_tail":"from_json works: True\nto_json works: True\nJSON roundtrip successful: True\nCompact to_json works: True\nAll checks passed!\n","stderr_tail":"","stdout_sha256":"30a9039078268a65c6677993dfe2f8c3d2bb416dcfe139345771669341ead16d","log_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/logs/agent1/agent1-7.log","tree_digest":null,"tree_download_s":null,"started_at":"2026-10-03T19:37:07.444262Z","duration_s":0.113865,"timed_out":false,"image_before":"af83156a-995f-4472-a517-914afc302aae","image_after":"288cd579-1cce-4791-b580-eda5c0b8de46","junit":null,"diff":null,"patch_sha256":null,"dropped_paths":[],"snapshot_sha":null}
{"receipt_id":"agent1-8","seq":8,"branch_id":"agent1","kind":"diff","cmd":"compute patch in executor staging agent1-9afe167a18174513bf42b83f24673c44: /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false add -A && /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false diff --cached --binary --no-ext-diff --no-textconv --no-renames b8ef5e8b0b6e2e0ddd53bb88f240ccde2456b59a","path":null,"exit_code":0,"stdout_tail":"diff --git a/dataclasses_jsonschema/__init__.py b/dataclasses_jsonschema/__init__.py\nindex b17098d..0c2dacb 100644\n--- a/dataclasses_jsonschema/__init__.py\n+++ b/dataclasses_jsonschema/__init__.py\n@@ -487,6 +487,45 @@ class JsonSchemaMixin:\n             setattr(instance, field_name, value)\n         return instance\n \n+    @classmethod\n+    def from_json(cls: Type[T], json_str: str, *, encoding: str = \"utf-8\", validate: bool = True, skip_invalid: bool = False) -> T:\n+        \"\"\"Creates a dataclass instance from a JSON string.\n+        \n+        Args:\n+            json_str: JSON string to parse\n+            encoding: Text encoding to use (default: utf-8)\n+            validate: Whether to validate against JSON schema (default: True)\n+            skip_invalid: Whether to skip invalid fields during parsing (default: False)\n+            \n+        Returns:\n+            Instance of the dataclass\n+        \"\"\"\n+        import json\n+        data = json.loads(json_str)\n+        if skip_invalid:\n+            # Filter out fields that don't exist in the dataclass\n+            valid_fields = {f.name for f in fields(cls)}\n+            data = {k: v for k, v in data.items() if k in valid_fields or cls.field_mapping().get(k) in valid_fields}\n+            # Reverse map field mapping for validation\n+            reverse_mapping = {v: k for k, v in cls.field_mapping().items()}\n+            data = {reverse_mapping.get(k, k): v for k, v in data.items()}\n+        return cls.from_dict(data, validate=validate)\n+\n+    def to_json(self, *, indent: int = None, ensure_ascii: bool = True, validate: bool = False) -> str:\n+        \"\"\"Serializes the dataclass instance to a JSON string.\n+        \n+        Args:\n+            indent: Indentation level for pretty-printing (default: None)\n+            ensure_ascii: Whether to escape non-ASCII characters (default: True)\n+            validate: Whether to validate against JSON schema before serializing (default: False)\n+            \n+        Returns:\n+            JSON string representation of the instance\n+        \"\"\"\n+        import json\n+        data = self.to_dict(validate=validate)\n+        return json.dumps(data, indent=indent, ensure_ascii=ensure_ascii)\n+\n     @staticmethod\n     def _is_json_schema_subclass(field_type) -> bool:\n         return issubclass_safe(field_type, JsonSchemaMixin)\n","stderr_tail":"","stdout_sha256":"f1dbc1fde956a4d13a4960a3ee8d5bdd5eed9f43e131bb3eef54c884c672927f","log_path":null,"tree_digest":"7cd1a70314d285ea7e75c96aab257c3781e85b4dff561c40fa47531a11c509dc","tree_download_s":1.978692625183612,"started_at":"2026-10-03T19:37:15.433009Z","duration_s":0.04393608286045492,"timed_out":false,"image_before":"288cd579-1cce-4791-b580-eda5c0b8de46","image_after":"288cd579-1cce-4791-b580-eda5c0b8de46","junit":null,"diff":{"files":[{"path":"dataclasses_jsonschema/__init__.py","added":39,"deleted":0,"category":"source","status":"modified"}],"patch_sha256":"f1dbc1fde956a4d13a4960a3ee8d5bdd5eed9f43e131bb3eef54c884c672927f","patch_path":"~/dev/nebius-hackathon/pilot/v2-P/s-knibbs__dataclasses-jsonschema-93/runs/pilot-s-knibbs__dataclasses-jsonschema-93-dfd35c894a/artifacts/agent1/agent1-8.patch"},"patch_sha256":"f1dbc1fde956a4d13a4960a3ee8d5bdd5eed9f43e131bb3eef54c884c672927f","dropped_paths":[],"snapshot_sha":"b8ef5e8b0b6e2e0ddd53bb88f240ccde2456b59a"}
