Skip to content

fix: v1 BaseController.to_json serialization error#22

Merged
simontaurus merged 1 commit into
mainfrom
dev
May 25, 2026
Merged

fix: v1 BaseController.to_json serialization error#22
simontaurus merged 1 commit into
mainfrom
dev

Conversation

@simontaurus
Copy link
Copy Markdown
Contributor

Fixes #20

v1 BaseController.to_json() failed when controller fields contained non-serializable objects (e.g. LocalDatabaseDriver). Now uses _raw_dict() to strip controller-only fields before serialization, matching the v2 behavior.

…errors (fixes #20)

v1 controllers with non-serializable fields (e.g. LocalDatabaseDriver)
caused TypeError in BaseModel.json(). Now uses _raw_dict() to build a
dict of only data-model fields before serialization, matching v2 behavior.
@github-actions
Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0015s → 0.0015s (-0.7%)
  ➖ test_sqlite_document_store: 0.0017s → 0.0018s (+5.6%)
  ➖ test_local_sparql_store: 0.0446s → 0.0365s (-18.2%)
  ➖ test_oneof_subschema: 0.0557s → 0.0520s (-6.5%)
  ➖ test_enum_docstrings: 0.0458s → 0.0464s (+1.3%)
  ➖ test_subclass_inheritance: 0.0447s → 0.0463s (+3.6%)
  ➖ test_class_hierarchy: 0.0434s → 0.0471s (+8.6%)
  ➖ test_core[v1]: 0.0371s → 0.0365s (-1.5%)
  ➖ test_core[v2]: 0.0434s → 0.0401s (-7.4%)
  ➖ test_schema_generation[v1]: 0.0016s → 0.0016s (+0.2%)
  ➖ test_schema_generation[v2]: 0.0028s → 0.0033s (+15.7%)
  ➖ test_simple_json: 0.0007s → 0.0007s (+0.1%)
  ➖ test_complex_graph: 0.0015s → 0.0015s (-0.2%)

============================================================
Summary: 0 regressions, 0 improvements, 13 unchanged
============================================================

✅ No significant performance regressions

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

@simontaurus simontaurus merged commit 747a7df into main May 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1 BaseController.to_json fails with non-serializable controller fields

1 participant