Skip to content

feat(standard-schema): standard_schema package (rename from schema_model) + utils + ack re-export#116

Open
leoafarias wants to merge 6 commits into
mainfrom
feat/schema-model-standard
Open

feat(standard-schema): standard_schema package (rename from schema_model) + utils + ack re-export#116
leoafarias wants to merge 6 commits into
mainfrom
feat/schema-model-standard

Conversation

@leoafarias

Copy link
Copy Markdown
Collaborator

Summary

Standardizes the Standard Schema contracts as the standard_schema package (renamed from schema_model) and wires Ack to it.

  • Rename schema_modelstandard_schema to match upstream @standard-schema/spec. The package holds the Standard Schema contracts (not a schema model); Ack's internal JSON-Schema model (ack/lib/src/schema_model/AckSchemaModel) is unaffected.
  • Faithful port, verified field-by-field against the canonical standard-schema/standard-schema index.ts (spec v1.1.0): StandardSchema, StandardJsonSchema, results/issues, validate options, JSON Schema converter + targets.
  • Opt-in utils (package:standard_schema/utils.dart) porting @standard-schema/utils: getDotPath(issue) and StandardSchemaError.
  • Ack re-exports the contract types from package:ack/ack.dart, so consumers don't need a separate standard_schema dependency.

Spec conformance (errors)

Failure output matches the spec's FailureResult/Issue/PathSegment: a flat issues array, each { message, path }, with object keys as strings and list indexes as ints (the PropertyKey form). A parity test maps real nested failures through getDotPathuser.tags.1, user.age.

Documented Dart deviations (all spec-permitted or generics-driven): ~standardstandard getter, dropped phantom types/InferInput/InferOutput, int version, bare-PropertyKey paths, Target as an extension type, and the Dart-only StandardSchemaWithJsonSchema convenience.

Breaking change

SchemaContext.createChild(pathSegment:) now takes a typed SchemaPathSegment (.property / .index / .passThrough) instead of a raw string — affects custom schema authors / manual context construction. Migration snippet in ack/CHANGELOG.md.

Publishing

standard_schema 0.0.1-dev.0 is published to pub.dev (prerelease) to reserve the name; Ack depends on >=0.0.1-dev.0 <0.1.0.

Verification

  • standard_schema: analyze clean, 9/9 tests.
  • ack: analyze clean, 937/937 tests.
  • dart format clean; dart pub publish --dry-run validates.

Moves AckSchemaModel and related types into a new `schema_model` package, adds legacy aliases in `ack` for backwards compatibility, and introduces standard_schema/schema_model_parser alongside updated changelogs and CI config.
Relocate schema model types, parser, and warnings from the schema_model
package into ack under the AckSchemaModel naming. Remove legacy aliases
and compat tests. Narrow schema_model to the StandardSchema validation
contract and update dependent packages and tests accordingly.
Split the StandardSchema contract into StandardTyped, StandardSchema,
StandardJsonSchema, and StandardSchemaWithJsonSchema to match the official
Standard Schema family. AckSchema now implements the combined
StandardSchemaWithJsonSchema contract.

Introduce a typed SchemaPathSegment so standard issue paths distinguish
string object keys from integer list indexes, preserving numeric-looking
object keys as strings.
… ack

Rename schema_model -> standard_schema to match @standard-schema/spec; the internal ack AckSchemaModel (lib/src/schema_model/) is unaffected. Add the opt-in utils.dart library (getDotPath + StandardSchemaError) porting @standard-schema/utils. Re-export the standard_schema contract types from package:ack so consumers no longer need a separate dependency. Document spec deviations and the SchemaPathSegment migration. Publish prep: standard_schema 0.0.1-dev.0 with ack's dependency constraint updated to match.
@docs-page

docs-page Bot commented Jun 10, 2026

Copy link
Copy Markdown

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/ack~116

Documentation is deployed and generated using docs.page.

CI resolves firebase_ai ^3.12.1 to 3.12.2 (the lock is gitignored, so it floats); the native fixture manifest tests assert the recorded sourceVersion matches the resolved package version. Regenerated via tool/generate_firebase_ai_response_json_schema_fixtures.dart -- only sourceVersion changed (3.12.1 -> 3.12.2); schema output is byte-identical. Fixes the failing 'manifest tracks every case and feature' tests.
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