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

Pattern matching in OpenAPI function args #517

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

stepantubanov
Copy link
Contributor

This is my attempt at adding support for pattern matching in function arguments.

Example code:

    #[OpenApi]
    impl Api {
        #[oai(path = "/test3/:user_id", method = "get")]
        async fn test3(&self, Path(user_id): Path<i32>) {
            assert_eq!(user_id, 7);
        }
    }

In current master this code doesn't compile ("Invalid param definition"), I updated the attribute macro code to allow it.

@sunli829
Copy link
Collaborator

sunli829 commented Mar 4, 2023

thanks 🙂

@sunli829 sunli829 merged commit 6b6d646 into poem-web:master Mar 10, 2023
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.

None yet

2 participants