feat(standard-schema): standard_schema package (rename from schema_model) + utils + ack re-export#116
Open
leoafarias wants to merge 6 commits into
Open
feat(standard-schema): standard_schema package (rename from schema_model) + utils + ack re-export#116leoafarias wants to merge 6 commits into
leoafarias wants to merge 6 commits into
Conversation
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.
|
To view this pull requests documentation preview, visit the following URL: 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standardizes the Standard Schema contracts as the
standard_schemapackage (renamed fromschema_model) and wires Ack to it.schema_model→standard_schemato 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.standard-schema/standard-schemaindex.ts(spec v1.1.0):StandardSchema,StandardJsonSchema, results/issues, validate options, JSON Schema converter + targets.package:standard_schema/utils.dart) porting@standard-schema/utils:getDotPath(issue)andStandardSchemaError.package:ack/ack.dart, so consumers don't need a separatestandard_schemadependency.Spec conformance (errors)
Failure output matches the spec's
FailureResult/Issue/PathSegment: a flatissuesarray, each{ message, path }, with object keys as strings and list indexes as ints (thePropertyKeyform). A parity test maps real nested failures throughgetDotPath→user.tags.1,user.age.Documented Dart deviations (all spec-permitted or generics-driven):
~standard→standardgetter, dropped phantomtypes/InferInput/InferOutput,intversion, bare-PropertyKeypaths,Targetas an extension type, and the Dart-onlyStandardSchemaWithJsonSchemaconvenience.Breaking change
SchemaContext.createChild(pathSegment:)now takes a typedSchemaPathSegment(.property/.index/.passThrough) instead of a raw string — affects custom schema authors / manual context construction. Migration snippet inack/CHANGELOG.md.Publishing
standard_schema 0.0.1-dev.0is 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 formatclean;dart pub publish --dry-runvalidates.