Skip to content

fix(macros): resolve Schematic paths through core or gotcha - #117

Merged
Kilerd merged 1 commit into
mainfrom
fix/derive-crate-paths
Sep 14, 2026
Merged

Kilerd merged 1 commit into
mainfrom
fix/derive-crate-paths

Conversation

@Kilerd

@Kilerd Kilerd commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

#[derive(gotcha::Schematic)] currently fails in a downstream application unless it adds a direct gotcha_core dependency and imports the trait. Resolve generated paths centrally through a direct core dependency or gotcha's core re-export, and qualify the generated trait reference.

Schematic remains defined in gotcha_core. Libraries can implement or derive it using core alone, and their types satisfy the application's re-exported trait. The derive recognizes Cargo dependency renames and supports #[schematic(crate = "path::to::gotcha_core")] for custom facades. All schema generators and field metadata use the selected path; schema generation behavior is unchanged. Crate discovery adds a macro compilation dependency, with no new runtime work.

Also re-export gotcha's existing validator crate. The documented single-dependency validation form uses #[derive(gotcha::Validate)] with #[validate(crate = "gotcha::validator")]; the explicit upstream override is still required. Remove the direct core dev-dependency workaround and update the two compiler diagnostic snapshots whose displayed paths changed with the re-export.

Validation:

  • Five standalone Cargo fixtures cover core-only and gotcha-only consumers, both dependency renames, and a custom facade with neither direct dependency. They verify cross-library trait compatibility, validation, and field metadata without importing Schematic. Dependency-tree checks reject web dependencies in core-only consumers. These checks now run in CI.
  • Gotcha default/all-features tests and doctests, core no-default/all-features tests and doctests, and macro unit tests passed.
  • Workspace Clippy with warnings denied, formatting, and documentation build with warnings denied passed.
  • All 11 GitHub CI checks passed for 15bab8ef0b4fdd7dc53483b37d386794480da5e8.

The feature-documentation inconsistency reported in #87 was already corrected by #115. The unrelated standalone build failure when disabling gotcha's default http1 feature is tracked separately in #116.

Fixes #87.

@Kilerd
Kilerd merged commit 17633f3 into main Sep 14, 2026
11 checks passed
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.

[dx] Derives emit paths into crates gotcha does not re-export, and the openapi feature docs contradict the manifest

1 participant