Skip to content

Commit

Permalink
fix(oapi-macros): Improved test_endpoint_generic
Browse files Browse the repository at this point in the history
  • Loading branch information
andeya committed Oct 10, 2024
1 parent a7fc162 commit bdf80e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/oapi-macros/tests/endpoint_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ fn test_endpoint_hello() {

#[test]
fn test_endpoint_generic() {
pub struct Generic<T: Sized>(T);
struct Generic<T: Sized>(T);

#[endpoint]
impl<T: Sized> Generic<T>
where
T: Send + Sync + 'static,
{
async fn handle(&self, _req: &mut Request) -> String {
String::new()
async fn handle(name: QueryParam<String, false>) -> String {
format!("[Generic] Hello, {}!", name.as_deref().unwrap_or("World"))
}
}

Expand All @@ -74,7 +74,7 @@ fn test_endpoint_generic() {
"paths":{
"/generic":{
"get":{
"operationId":"endpoint_tests.test_endpoint_generic.generic",
"operationId":"endpoint_tests.test_endpoint_generic.Generic",
"parameters":[{
"name":"name",
"in":"query",
Expand Down

0 comments on commit bdf80e6

Please sign in to comment.