Skip to content

docs: add documentation to schemantic_builder entry point#294

Open
pavelgj wants to merge 1 commit into
mainfrom
pj/schemantic_builder_score_fixes1
Open

docs: add documentation to schemantic_builder entry point#294
pavelgj wants to merge 1 commit into
mainfrom
pj/schemantic_builder_score_fixes1

Conversation

@pavelgj

@pavelgj pavelgj commented Jun 4, 2026

Copy link
Copy Markdown
Member

Add library and method documentation to the schemantic_builder entry point, clarifying that it is invoked by build_runner and describing the schemaBuilder factory behavior.

Add library and method documentation to the schemantic_builder
entry point, clarifying that it is invoked by build_runner and
describing the schemaBuilder factory behavior.
@pavelgj pavelgj requested a review from chrisraygill June 4, 2026 01:29

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a README.md example for the schemantic_builder package and introduces library-level and function-level documentation comments in builder.dart. The review feedback suggests improving the documentation comments in builder.dart by using a @docImport directive to import package:schemantic/schemantic.dart and referencing [Schema] instead of using code spans, which will make the type clickable in the generated documentation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +15 to +21
/// The `build_runner` entry point for the `schemantic` code generator.
///
/// This library exposes the [schemaBuilder] factory referenced by
/// `build.yaml`. It is not intended to be imported directly in application
/// code; instead it is invoked by `build_runner` to generate the `*.g.dart`
/// part files for classes annotated with `@Schema`.
library;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make the Schema type clickable and properly resolved in the generated documentation, use a @docImport directive to import package:schemantic/schemantic.dart and reference it as [Schema] instead of using a code span.

/// @docImport 'package:schemantic/schemantic.dart';
///
/// The build_runner entry point for the schemantic code generator.
///
/// This library exposes the [schemaBuilder] factory referenced by
/// build.yaml. It is not intended to be imported directly in application
/// code; instead it is invoked by build_runner to generate the *.g.dart
/// part files for classes annotated with [Schema].
library;
References
  1. In Dart, @DocImport directives are required to make types visible in documentation comments, even if those types are already exposed via export directives.

Comment on lines +28 to 35
/// Creates the [Builder] used by `build_runner` to generate `schemantic`
/// data classes and JSON schemas.
///
/// The builder emits a shared part file (with the `schemantic` extension) for
/// every input library, running the schema generator over each `@Schema`
/// annotated declaration. The [options] are supplied by `build_runner` based
/// on the configuration in `build.yaml`.
Builder schemaBuilder(BuilderOptions options) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Reference the Schema class as [Schema] instead of a code span to make it a clickable link in the documentation, now that the @docImport is available.

/// Creates the [Builder] used by build_runner to generate schemantic
/// data classes and JSON schemas.
///
/// The builder emits a shared part file (with the schemantic extension) for
/// every input library, running the schema generator over each [Schema]
/// annotated declaration. The [options] are supplied by build_runner based
/// on the configuration in build.yaml.
Builder schemaBuilder(BuilderOptions options) =>

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