Skip to content

OpenAPI Request Body generation with #[json]  #104

@wallagib

Description

@wallagib

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> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions