Skip to content

Remove deprecated inferSchema library function#19

Open
hakimjonas wants to merge 1 commit into
mainfrom
chore/remove-infer-schema
Open

Remove deprecated inferSchema library function#19
hakimjonas wants to merge 1 commit into
mainfrom
chore/remove-infer-schema

Conversation

@hakimjonas

Copy link
Copy Markdown
Owner

First item of the 0.14.0 cycle.

Why

inferSchema was deprecated in 0.9.0 — it emitted a lossy type-name structure ({a: "number"}) that doesn't round-trip — with removal scheduled for 1.0. Removing it now in 0.14.0.

What

  • Delete the function (lib/src/output.dart) and its export (lib/lambe.dart).
  • Remove the inferSchema test group + the one inferSchema case in the Ring 6 group (test/ring6_test.dart). No coverage lost — the replacements shapeOf / renderJsonSchema have their own suites (schema_renderer_test.dart).
  • Update example/example.dart to the replacement: renderJsonSchema(shapeOf(data)).
  • CHANGELOG: a fresh ## Unreleased → Breaking entry.

Replacement (already exported)

  • renderJsonSchema(shapeOf(value)) → JSON Schema document that round-trips with parseJsonSchema
  • shapeOf(value) → the Shape ADT

Impact

Breaking for package:lambe library consumers only. CLI and MCP unaffected — neither used it. Deprecated for 4 releases (0.9→0.13), so defensible.

Verification

analyze --fatal-infos, format, lint-changelog, generated-files-in-sync all green; full suite 1680 pass (down 7 = the removed inferSchema assertions); example runs and emits JSON Schema.

Note: pubspec stays at 0.13.0 here; the 0.14.0 version bump lands in the final release PR.

Deprecated in 0.9.0 (lossy type-name output, no round-trip) with removal
scheduled for 1.0; removing it now in the 0.14.0 cycle. Replacements
already exist and are exported: renderJsonSchema(shapeOf(value)) for a
JSON Schema document, or shapeOf(value) for the Shape ADT.

- Delete the function from lib/src/output.dart and its export from
  lib/lambe.dart.
- Remove the inferSchema test group + the one inferSchema case in the
  Ring 6 group from test/ring6_test.dart. No coverage lost: shapeOf and
  renderJsonSchema have their own suites (schema_renderer_test.dart).
- Update example/example.dart to renderJsonSchema(shapeOf(data)).
- CHANGELOG: Breaking entry.

CLI and MCP unaffected (neither used it). analyze/format/lint-changelog/
generated-files green; full suite 1680 pass.
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.

1 participant