Repository navigation
feat(generator): add explicit schema descriptions - #176
Merged
Merged
Conversation
leoafarias
force-pushed
the
release/1.7
branch
from
September 29, 2026 14:09
88a2070 to
c498de5
Compare
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Add `description:` to `@AckModel` and `@AckField`. When no annotation description is present, read a single-line `@description` tag from `///` or `/** */` documentation. Untagged prose and `//` comments never export. Blank or duplicate tags fail with source-located diagnostics. Class descriptions apply to the wire object and model codec, including union bases and branches. Field descriptions apply only to the property. This replaces the unreleased whole-doc-comment fallback on main. Class-first string literals now escape control characters too. Revises #176.
leoafarias
force-pushed
the
feat/ackmodel-class-description
branch
from
September 29, 2026 14:09
7436561 to
18446b1
Compare
This was referenced Sep 29, 2026
leoafarias
changed the base branch from
release/1.7
to
codex/ack-v2-generator-literals
September 29, 2026 14:10
leoafarias
added this pull request to stack #178
September 29, 2026 14:11
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Add `description:` to `@AckModel` and `@AckField`. When no annotation description is present, read a single-line `@description` tag from `///` or `/** */` documentation. Untagged prose and `//` comments never export. Blank or duplicate tags fail with source-located diagnostics. Class descriptions apply to the wire object and model codec, including union bases and branches. Field descriptions apply only to the property. This replaces the unreleased whole-doc-comment fallback on main. Class-first string literals now escape control characters too. Revises #176.
leoafarias
force-pushed
the
codex/ack-v2-generator-literals
branch
from
September 29, 2026 14:21
d241b4c to
9d3b2df
Compare
leoafarias
force-pushed
the
feat/ackmodel-class-description
branch
from
September 29, 2026 14:21
18446b1 to
4fefa74
Compare
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Add `description:` to `@AckModel` and `@AckField`. When no annotation description is present, read a single-line `@description` tag from `///` or `/** */` documentation. Untagged prose and `//` comments never export. Blank or duplicate tags fail with source-located diagnostics. Class descriptions apply to the wire object and model codec, including union bases and branches. Field descriptions apply only to the property. This replaces the unreleased whole-doc-comment fallback on main. Class-first string literals now escape control characters too. Revises #176.
leoafarias
force-pushed
the
codex/ack-v2-generator-literals
branch
from
September 29, 2026 14:55
9d3b2df to
f552a36
Compare
leoafarias
force-pushed
the
feat/ackmodel-class-description
branch
from
September 29, 2026 14:55
4fefa74 to
32b7091
Compare
leoafarias
marked this pull request as ready for review
September 29, 2026 15:06
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Add `description:` to `@AckModel` and `@AckField`. When no annotation description is present, read a single-line `@description` tag from `///` or `/** */` documentation. Untagged prose and `//` comments never export. Blank or duplicate tags fail with source-located diagnostics. Class descriptions apply to the wire object and model codec, including union bases and branches. Field descriptions apply only to the property. This replaces the unreleased whole-doc-comment fallback on main. Class-first string literals now escape control characters too. Revises #176.
leoafarias
force-pushed
the
codex/ack-v2-generator-literals
branch
from
September 29, 2026 15:43
f552a36 to
e35891d
Compare
leoafarias
force-pushed
the
feat/ackmodel-class-description
branch
from
September 29, 2026 15:43
32b7091 to
2d63230
Compare
Add `description:` to `@AckModel` and `@AckField`. When no annotation description is present, read a single-line `@description` tag from `///` or `/** */` documentation. Untagged prose and `//` comments never export. Blank or duplicate tags fail with source-located diagnostics. Class descriptions apply to the wire object and model codec, including union bases and branches. Field descriptions apply only to the property. This replaces the unreleased whole-doc-comment fallback on main. Class-first string literals now escape control characters too. Revises #176.
Only a bare fence marker closes an open code fence, so a ```dart line inside a fence no longer exposes a following @description tag. Cover blank annotation descriptions, make the authored-description test able to fail, and rename tests that still described doc-comment export.
leoafarias
removed this pull request from stack #178
September 29, 2026 16:53
leoafarias
force-pushed
the
codex/ack-v2-generator-literals
branch
from
September 29, 2026 16:53
e35891d to
ab642a9
Compare
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Align the six publishable packages at 1.7.0-beta.1 and move unreleased notes into the 1.7.0-beta.1 changelog sections. The release includes shared inference, model adapter schemas, CodecSchema.canEncode, typed copyWith, stricter constrained-Set validation, the @AckInfer schema shorthand (#174), generated string-literal escaping (#164), and explicit schema descriptions (#176). Update PUBLISHING.md for this candidate. The Draft 2020-12 runtime (#171), JSON Schema-to-Dart generation (#167), and the decoder error contract (#163) are deferred to 2.0.
leoafarias
force-pushed
the
feat/ackmodel-class-description
branch
from
September 29, 2026 16:53
2d63230 to
587fc69
Compare
Base automatically changed from
codex/ack-v2-generator-literals
to
release/1.7
September 29, 2026 16:53
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
description:to@AckModeland@AckField.@descriptiontag from a///or/** */doc comment. Annotation text takes precedence over the tag.//comments never become schema descriptions. Tags inside fenced code examples are ignored; only a bare fence marker closes a fence. Blank or duplicate tags fail generation with a source-located error, and so does a blankdescription:annotation.XSchema.schema,wireSchema,toJsonSchema(), andtoSchemaModel()agree. Field descriptions apply only at the property and don't change a nested model's own description.AckSchemaInference.applyDescription(shared inference) uses the same rule and honors@AckField(description:).dartStringLiteral, so annotation text such as'First\nsecond'generates valid source.Behavior change
This replaces the whole-doc-comment behavior that was on
mainbut never released (1.6.2 did not export doc comments). Code that relied on untagged docs must adddescription:or an@descriptiontag. The generator changelog and README,@AckModel/@AckFielddocs,typesafe-schemas.mdx, andllms.txtdescribe the rule.The example models were updated and regenerated. The top commit also updates
PUBLISHING.mdto describe the full 1.7 beta scope.Base: #164, which contains the inferred-literal fix this PR builds on. This branch was rebased after typed
copyWithreturned to 1.7. The runtime-build and graph test fixtures keep both thecopyWithand the description cases. Review fix2d632300tightens fence closing, adds blank-annotation tests, makes the authored-description test able to fail, and renames tests that still described doc-comment export. A tag on an indented line (/// @description) is still read.Closes #175
Validation
Validated locally on the combined 1.7 tree (
feat/ackmodel-class-description, head2d632300), which includes every PR in the stack:dart run melos run test --no-selectpassed. Strict analysis (--fatal-infos) found no issues in all seven packages. Tests passed:ack1,311,ack_generator347,ack_firebase_ai98,ack_mcp_dart63,ack_json_schema_builder51,ack_annotations8, plus the root and example suites.*.ack.dart/*.g.dart, thenmelos run build) reproduced the committed output exactly.dart scripts/api_check.dart 1.6.2reported no breaking changes in any of the six packages. It cannot inspect generated consumer code, so it does not flag the typedcopyWithgetter; theack_generatorchangelog documents that under Breaking.dart scripts/publish_dry_run.dartreported 0 warnings for all six packages.verify_release_tag v1.7.0-beta.1 --skip-ancestry,dart format --set-exit-if-changed, andgit diff --checkpassed.Setcodegen in chore(release): prepare Ack 1.7.0-beta.2 #168,schemaimport prefix in feat(generator): add a static schema shorthand to AckInfer models #174) and the non-blocking fixes are included.