-
Notifications
You must be signed in to change notification settings - Fork 220
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
Allow alias for serde_json::Value: Gobal Rusts Type Alias registry #766
Comments
Unfortunately this is not possible at the moment. This needs a global registry for the type aliases that is available for the macro compile process. This would need some experimenting in order to find the right solution. This is not straight forward to implement to my reckoning, yet the support would be quite beneficial for the library and the users. Definitely something that can be investigated in future. |
This PR adds global config for `utiopa` which allows defining global Rust type aliases that can be recognized by `utoipa`. ```rust let _ = Config::new() .alias_for("MyType", "i32"); .alias_for("Json", "Value"); .alias_for("NullableString", "Option<String>"); ``` Closes #984 Closes #787 Closes #766 Closes #429
@JoverZhang There is now coming a new PR which adds global type aliases for |
Hello.
Instead of using
serde_json::Value
directly, we added an aliasJson
forserde_json::Value
.But the
Json
won't be recognized asserde_json::Value
.This would make it recognizable, but that doesn't make much sense.
Could it be like
#[aliases]
, where to write it once, and it's consistently recognized asserde_json::Value
?The text was updated successfully, but these errors were encountered: