We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, there's no nice way to specify enums in paths. You can do something like this:
pub struct Api; #[derive(Enum, Deserialize)] #[oai(rename_all = "lowercase")] pub enum Choices { Foo, Bar, } #[OpenApi] impl Api { #[oai(path = "/pick/:choices", method = "get")] pub async fn pick(&self, choices: Path<Choices>) -> PlainText<String> { PlainText("hello world".to_string()) } }
But the resulting paths will be /pick/Foo and /pick/Bar (rename_all is ignored). The enum choices will not be included in the spec either.
/pick/Foo
/pick/Bar
rename_all
In OpenAPI, it should be possible to define enums in the path:
paths: /pick/{choices}: get: parameters: - in: path name: choices required: true type: string enum: [foo, bar]
It would be nice if we can express this constraint with poem-openapi.
poem-openapi
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description of the feature
Currently, there's no nice way to specify enums in paths. You can do something like this:
But the resulting paths will be
/pick/Foo
and/pick/Bar
(rename_all
is ignored). The enum choices will not be included in the spec either.In OpenAPI, it should be possible to define enums in the path:
It would be nice if we can express this constraint with
poem-openapi
.The text was updated successfully, but these errors were encountered: