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

allow path in status for ApiResponse #937

Merged

Conversation

ihor-rud
Copy link
Contributor

This mr adds ability to use constant as status code in ApiResponse macro. I found it to be extremely convenient in my codebase. It should be easy to use the same approach in other places where literal is expected.

const OK_STATUS: u16 = 200;

#[derive(ApiResponse)]
enum MyResponse {
    #[oai(status = OK_STATUS)]
    Ok,
}

@attila-lin attila-lin merged commit 38e6002 into poem-web:master Jan 2, 2025
7 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.

2 participants