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

OpenAPI Request Body generation with #[json] #104

Open
wallagib opened this issue Jun 13, 2022 · 0 comments
Open

OpenAPI Request Body generation with #[json] #104

wallagib opened this issue Jun 13, 2022 · 0 comments

Comments

@wallagib
Copy link

Hi!

I haven't found any documentation that suggests this shouldn't work, but the OpenAPI doc generation doesn't seem to pick up arguments tagged with #[json] .

The Response field in the OpenAPI docs is generated appropriately. Do fields need to use the explicit request: Json<ActiveRequest> syntax instead?

#[post("/v1/test/active")]
#[openapi(id = "test_active")]
pub async fn test_set_active(
    #[filter = "authtoken"] auth_token: Option<String>,
    #[json] request: ActiveRequest
    #[data] client: reqwest::Client,
) -> Result<Json<ActiveResponse>, Rejection> 
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

No branches or pull requests

1 participant