-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
we are inadvertently generating OpenAPI documents with wildcard path …
…parameters (#197)
- Loading branch information
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2021 Oxide Computer Company | ||
|
||
#![allow(unused_imports)] | ||
|
||
use dropshot::endpoint; | ||
use dropshot::HttpError; | ||
use dropshot::HttpResponseOk; | ||
use dropshot::Path; | ||
use dropshot::RequestContext; | ||
use schemars::JsonSchema; | ||
use serde::Deserialize; | ||
use std::sync::Arc; | ||
|
||
#[derive(JsonSchema, Deserialize)] | ||
struct PathParams { | ||
stuff: Vec<String>, | ||
} | ||
|
||
#[endpoint { | ||
method = GET, | ||
path = "/assets/{stuff:.*}", | ||
}] | ||
async fn must_be_unpublished( | ||
_: Arc<RequestContext<()>>, | ||
_: Path<PathParams>, | ||
) -> Result<HttpResponseOk<String>, HttpError> { | ||
panic!() | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error: paths that contain a wildcard match must include 'unpublished = true' | ||
--> tests/fail/bad_endpoint14.rs:20:5 | ||
| | ||
20 | / method = GET, | ||
21 | | path = "/assets/{stuff:.*}", | ||
| |________________________________^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters