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

Support actix_web::Result for Query Parameters #145

Open
Martichou opened this issue Jan 26, 2025 · 0 comments
Open

Support actix_web::Result for Query Parameters #145

Martichou opened this issue Jan 26, 2025 · 0 comments

Comments

@Martichou
Copy link

Hey there! First of, thanks for this library, it's pretty useful :)

So my use case is as follow:

/// Get events time series analytics.
///
/// This endpoint returns click and scan counts over time.
#[protect("_USER", "owner")]
#[api_operation(tag = "analytics")]
pub async fn get_events_timeseries(
    Header(CurrentOrg(current_org)): Header<CurrentOrg>,
    pool: web::Data<PgPool>,
    _key: ApiKey,
    query: actix_web::Result<web::Query<AnalyticsTimeRange>>,
) -> Result<OkJson<Vec<TimeSeriesStats>>, errors::PError> {
    ...
}

Currently, apistos doesn't document the query parts as parameters in the openapi spec generated, it's omitting it. I suppose this is because actix_web::Result isn't supported (can it even be supported?).

I see the same issue when using Option<>, it's just omitted instead of marked as non-required.

If you have some time to look at it, or even just to point me on how it should be resolved (if possible), it'd be appreciated!

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