Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path rewrite support #1110

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Add path rewrite support #1110

merged 1 commit into from
Oct 9, 2024

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Oct 9, 2024

This PR further enhances generics allowing use of utoipa-config aliases and third-party types like Uuid to be used in generic arguments of types. Third-party types must be one of known primitive types that can be enabled with a cargo feature flag e.g. uuid.

Now the following will work which previously caused a compile error.

 #[derive(ToSchema)]
 pub struct High<T> {
     high: T,
 }

 #[derive(ToSchema)]
 pub struct HighUuid(High<Option<uuid::Uuid>>);

Fixes #1099

@juhaku juhaku force-pushed the feature-impl-path-rewrite branch from e8b51bf to ab45419 Compare October 9, 2024 16:53
This PR further enhances generics allowing use of `utoipa-config`
aliases and third-party types like `Uuid` to be used in generic
arguments of types. Third-party types must be one of known primitive
types that can be enabled with a cargo feature flag e.g. `uuid`.

Now the following will work which previously caused a compile error.
```rust
 #[derive(ToSchema)]
 pub struct High<T> {
     high: T,
 }

 #[derive(ToSchema)]
 pub struct HighUuid(High<Option<uuid::Uuid>>);
```

Fixes #1099
@juhaku juhaku force-pushed the feature-impl-path-rewrite branch from ab45419 to 7bf3fae Compare October 9, 2024 16:56
@juhaku juhaku merged commit fc22ddf into master Oct 9, 2024
22 checks passed
@juhaku juhaku deleted the feature-impl-path-rewrite branch October 9, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

the trait bound Option<i32>: ToSchema is not satisfied
1 participant