Skip to content

fix(utoipa-gen): disambiguate ToSchema::name conversion for Cow<str>#1519

Open
cfilipescu wants to merge 2 commits intojuhaku:masterfrom
cfilipescu:fix/utoipa-gen-cow-asref-ambiguity
Open

fix(utoipa-gen): disambiguate ToSchema::name conversion for Cow<str>#1519
cfilipescu wants to merge 2 commits intojuhaku:masterfrom
cfilipescu:fix/utoipa-gen-cow-asref-ambiguity

Conversation

@cfilipescu
Copy link
Copy Markdown

Summary

  • Replace String::from(<...>::name().as_ref()) with String::from(&*<...>::name()) in utoipa-gen.
  • This avoids ambiguous trait inference when downstream dependency graphs introduce additional AsRef impls for Cow<'_, str>.
  • Behavior stays the same; this only makes the conversion target explicit.

Validation

  • cargo fmt --check --package utoipa-gen
  • cargo clippy --quiet --package utoipa-gen
  • ./scripts/test.sh utoipa-gen

Downstream Repro Check

  • Verified in a downstream workspace where upgrading zip to 7.4.x triggered the ambiguity.
  • With this patch applied, cargo clippy --all-targets -- -Dwarnings passes.

@ctron
Copy link
Copy Markdown
Contributor

ctron commented Feb 10, 2026

Just ran into the same issue. Came up with the same fix. It would be helpful to have this merged and released.

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.

2 participants