From cfef948c11bb5228fc1aa0635254db6674c21f54 Mon Sep 17 00:00:00 2001 From: Linh Tran Tuan Date: Thu, 7 Nov 2024 19:39:51 +0900 Subject: [PATCH] [Rust-Axum] [Breaking Changes] Prevent Operation response with internal Error (#20047) * [Rust-Axum] Fix: prevent Operation returns Internal Server Error * Update --- .../main/resources/rust-axum/apis.mustache | 2 +- .../output/apikey-auths/src/apis/payments.rs | 6 +- .../output/multipart-v3/src/apis/default.rs | 6 +- .../output/openapi-v3/src/apis/default.rs | 59 +++++++-------- .../output/openapi-v3/src/apis/info_repo.rs | 2 +- .../output/openapi-v3/src/apis/repo.rs | 2 +- .../output/ops-v3/src/apis/default.rs | 74 +++++++++---------- .../src/apis/another_fake.rs | 2 +- .../src/apis/fake.rs | 26 +++---- .../src/apis/fake_classname_tags123.rs | 2 +- .../src/apis/pet.rs | 16 ++-- .../src/apis/store.rs | 8 +- .../src/apis/user.rs | 16 ++-- .../rust-axum/output/petstore/src/apis/pet.rs | 16 ++-- .../output/petstore/src/apis/store.rs | 8 +- .../output/petstore/src/apis/user.rs | 16 ++-- .../ping-bearer-auth/src/apis/default.rs | 2 +- .../rust-axum-header-uuid/src/apis/default.rs | 2 +- .../output/rust-axum-test/src/apis/default.rs | 18 ++--- .../src/apis/default.rs | 2 +- 20 files changed, 141 insertions(+), 144 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache index a44f21379bf9..b897475dea79 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache @@ -72,7 +72,7 @@ pub trait {{classnamePascalCase}} { {{#x-consumes-multipart-related}} body: axum::body::Body, {{/x-consumes-multipart-related}} - ) -> Result<{{{operationId}}}Response, String>; + ) -> Result<{{{operationId}}}Response, ()>; {{/vendorExtensions}} {{^-last}} diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs index 4d824e3a9c13..0c694b6d08e8 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs +++ b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs @@ -48,7 +48,7 @@ pub trait Payments { host: Host, cookies: CookieJar, path_params: models::GetPaymentMethodByIdPathParams, - ) -> Result; + ) -> Result; /// Get payment methods. /// @@ -58,7 +58,7 @@ pub trait Payments { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Make a payment. /// @@ -70,5 +70,5 @@ pub trait Payments { cookies: CookieJar, token_in_cookie: Option, body: Option, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs index 27d8cf2ee301..ad21c532ae7e 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs @@ -42,7 +42,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: axum::body::Body, - ) -> Result; + ) -> Result; /// MultipartRequestPost - POST /multipart_request async fn multipart_request_post( @@ -51,7 +51,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Multipart, - ) -> Result; + ) -> Result; /// MultipleIdenticalMimeTypesPost - POST /multiple-identical-mime-types async fn multiple_identical_mime_types_post( @@ -60,5 +60,5 @@ pub trait Default { host: Host, cookies: CookieJar, body: axum::body::Body, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs index c8908cfc14d8..0e7b62722ca2 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs @@ -282,7 +282,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::AnyOfGetQueryParams, - ) -> Result; + ) -> Result; /// CallbackWithHeaderPost - POST /callback-with-header async fn callback_with_header_post( @@ -291,7 +291,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::CallbackWithHeaderPostQueryParams, - ) -> Result; + ) -> Result; /// ComplexQueryParamGet - GET /complex-query-param async fn complex_query_param_get( @@ -300,7 +300,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::ComplexQueryParamGetQueryParams, - ) -> Result; + ) -> Result; /// EnumInPathPathParamGet - GET /enum_in_path/{path_param} async fn enum_in_path_path_param_get( @@ -309,7 +309,7 @@ pub trait Default { host: Host, cookies: CookieJar, path_params: models::EnumInPathPathParamGetPathParams, - ) -> Result; + ) -> Result; /// Test a Form Post. /// @@ -320,7 +320,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: models::FormTestRequest, - ) -> Result; + ) -> Result; /// GetWithBooleanParameter - GET /get-with-bool async fn get_with_boolean_parameter( @@ -329,7 +329,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::GetWithBooleanParameterQueryParams, - ) -> Result; + ) -> Result; /// JsonComplexQueryParamGet - GET /json-complex-query-param async fn json_complex_query_param_get( @@ -338,7 +338,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::JsonComplexQueryParamGetQueryParams, - ) -> Result; + ) -> Result; /// MandatoryRequestHeaderGet - GET /mandatory-request-header async fn mandatory_request_header_get( @@ -347,7 +347,7 @@ pub trait Default { host: Host, cookies: CookieJar, header_params: models::MandatoryRequestHeaderGetHeaderParams, - ) -> Result; + ) -> Result; /// MergePatchJsonGet - GET /merge-patch-json async fn merge_patch_json_get( @@ -355,7 +355,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Get some stuff.. /// @@ -365,7 +365,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// MultipleAuthSchemeGet - GET /multiple_auth_scheme async fn multiple_auth_scheme_get( @@ -373,7 +373,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// MultiplePathParamsWithVeryLongPathToTestFormattingPathParamAPathParamBGet - GET /multiple-path-params-with-very-long-path-to-test-formatting/{path_param_a}/{path_param_b} async fn multiple_path_params_with_very_long_path_to_test_formatting_path_param_a_path_param_b_get( @@ -382,10 +382,7 @@ pub trait Default { host: Host, cookies: CookieJar, path_params: models::MultiplePathParamsWithVeryLongPathToTestFormattingPathParamAPathParamBGetPathParams, - ) -> Result< - MultiplePathParamsWithVeryLongPathToTestFormattingPathParamAPathParamBGetResponse, - String, - >; + ) -> Result; /// OneOfGet - GET /one-of async fn one_of_get( @@ -393,7 +390,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// OverrideServerGet - GET /override-server async fn override_server_get( @@ -401,7 +398,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Get some stuff with parameters.. /// @@ -412,7 +409,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::ParamgetGetQueryParams, - ) -> Result; + ) -> Result; /// ReadonlyAuthSchemeGet - GET /readonly_auth_scheme async fn readonly_auth_scheme_get( @@ -420,7 +417,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// RegisterCallbackPost - POST /register-callback async fn register_callback_post( @@ -429,7 +426,7 @@ pub trait Default { host: Host, cookies: CookieJar, query_params: models::RegisterCallbackPostQueryParams, - ) -> Result; + ) -> Result; /// RequiredOctetStreamPut - PUT /required_octet_stream async fn required_octet_stream_put( @@ -438,7 +435,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; /// ResponsesWithHeadersGet - GET /responses_with_headers async fn responses_with_headers_get( @@ -446,7 +443,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Rfc7807Get - GET /rfc7807 async fn rfc7807_get( @@ -454,7 +451,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// TwoFirstLetterHeaders - POST /operation-two-first-letter-headers async fn two_first_letter_headers( @@ -463,7 +460,7 @@ pub trait Default { host: Host, cookies: CookieJar, header_params: models::TwoFirstLetterHeadersHeaderParams, - ) -> Result; + ) -> Result; /// UntypedPropertyGet - GET /untyped_property async fn untyped_property_get( @@ -472,7 +469,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Option, - ) -> Result; + ) -> Result; /// UuidGet - GET /uuid async fn uuid_get( @@ -480,7 +477,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// XmlExtraPost - POST /xml_extra async fn xml_extra_post( @@ -489,7 +486,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; /// XmlOtherPost - POST /xml_other async fn xml_other_post( @@ -498,7 +495,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; /// XmlOtherPut - PUT /xml_other async fn xml_other_put( @@ -507,7 +504,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; /// Post an array. It's important we test apostrophes, so include one here.. /// @@ -518,7 +515,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; /// XmlPut - PUT /xml async fn xml_put( @@ -527,5 +524,5 @@ pub trait Default { host: Host, cookies: CookieJar, body: Bytes, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs index bd68394bf230..c73db4a16d43 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs @@ -26,5 +26,5 @@ pub trait InfoRepo { host: Host, cookies: CookieJar, path_params: models::GetRepoInfoPathParams, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs index e08336d7799e..90d9a774f6e1 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs @@ -26,5 +26,5 @@ pub trait Repo { host: Host, cookies: CookieJar, body: models::ObjectParam, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs index c24558c161db..387f4b3fa792 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs @@ -313,7 +313,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op11Get - GET /op11 async fn op11_get( @@ -321,7 +321,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op12Get - GET /op12 async fn op12_get( @@ -329,7 +329,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op13Get - GET /op13 async fn op13_get( @@ -337,7 +337,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op14Get - GET /op14 async fn op14_get( @@ -345,7 +345,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op15Get - GET /op15 async fn op15_get( @@ -353,7 +353,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op16Get - GET /op16 async fn op16_get( @@ -361,7 +361,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op17Get - GET /op17 async fn op17_get( @@ -369,7 +369,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op18Get - GET /op18 async fn op18_get( @@ -377,7 +377,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op19Get - GET /op19 async fn op19_get( @@ -385,7 +385,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op1Get - GET /op1 async fn op1_get( @@ -393,7 +393,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op20Get - GET /op20 async fn op20_get( @@ -401,7 +401,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op21Get - GET /op21 async fn op21_get( @@ -409,7 +409,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op22Get - GET /op22 async fn op22_get( @@ -417,7 +417,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op23Get - GET /op23 async fn op23_get( @@ -425,7 +425,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op24Get - GET /op24 async fn op24_get( @@ -433,7 +433,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op25Get - GET /op25 async fn op25_get( @@ -441,7 +441,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op26Get - GET /op26 async fn op26_get( @@ -449,7 +449,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op27Get - GET /op27 async fn op27_get( @@ -457,7 +457,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op28Get - GET /op28 async fn op28_get( @@ -465,7 +465,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op29Get - GET /op29 async fn op29_get( @@ -473,7 +473,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op2Get - GET /op2 async fn op2_get( @@ -481,7 +481,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op30Get - GET /op30 async fn op30_get( @@ -489,7 +489,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op31Get - GET /op31 async fn op31_get( @@ -497,7 +497,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op32Get - GET /op32 async fn op32_get( @@ -505,7 +505,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op33Get - GET /op33 async fn op33_get( @@ -513,7 +513,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op34Get - GET /op34 async fn op34_get( @@ -521,7 +521,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op35Get - GET /op35 async fn op35_get( @@ -529,7 +529,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op36Get - GET /op36 async fn op36_get( @@ -537,7 +537,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op37Get - GET /op37 async fn op37_get( @@ -545,7 +545,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op3Get - GET /op3 async fn op3_get( @@ -553,7 +553,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op4Get - GET /op4 async fn op4_get( @@ -561,7 +561,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op5Get - GET /op5 async fn op5_get( @@ -569,7 +569,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op6Get - GET /op6 async fn op6_get( @@ -577,7 +577,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op7Get - GET /op7 async fn op7_get( @@ -585,7 +585,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op8Get - GET /op8 async fn op8_get( @@ -593,7 +593,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Op9Get - GET /op9 async fn op9_get( @@ -601,5 +601,5 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs index 99c6307abe80..f64e2e451bb9 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs @@ -28,5 +28,5 @@ pub trait AnotherFake { host: Host, cookies: CookieJar, body: models::Client, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs index 38c5c477b253..22ad661101aa 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs @@ -125,7 +125,7 @@ pub trait Fake { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// FakeOuterBooleanSerialize - POST /v2/fake/outer/boolean async fn fake_outer_boolean_serialize( @@ -134,7 +134,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: Option, - ) -> Result; + ) -> Result; /// FakeOuterCompositeSerialize - POST /v2/fake/outer/composite async fn fake_outer_composite_serialize( @@ -143,7 +143,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: Option, - ) -> Result; + ) -> Result; /// FakeOuterNumberSerialize - POST /v2/fake/outer/number async fn fake_outer_number_serialize( @@ -152,7 +152,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: Option, - ) -> Result; + ) -> Result; /// FakeOuterStringSerialize - POST /v2/fake/outer/string async fn fake_outer_string_serialize( @@ -161,7 +161,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: Option, - ) -> Result; + ) -> Result; /// FakeResponseWithNumericalDescription - GET /v2/fake/response-with-numerical-description async fn fake_response_with_numerical_description( @@ -169,7 +169,7 @@ pub trait Fake { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// HyphenParam - GET /v2/fake/hyphenParam/{hyphen-param} async fn hyphen_param( @@ -178,7 +178,7 @@ pub trait Fake { host: Host, cookies: CookieJar, path_params: models::HyphenParamPathParams, - ) -> Result; + ) -> Result; /// TestBodyWithQueryParams - PUT /v2/fake/body-with-query-params async fn test_body_with_query_params( @@ -188,7 +188,7 @@ pub trait Fake { cookies: CookieJar, query_params: models::TestBodyWithQueryParamsQueryParams, body: models::User, - ) -> Result; + ) -> Result; /// To test \"client\" model. /// @@ -199,7 +199,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: models::Client, - ) -> Result; + ) -> Result; /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. /// @@ -210,7 +210,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: models::TestEndpointParametersRequest, - ) -> Result; + ) -> Result; /// To test enum parameters. /// @@ -223,7 +223,7 @@ pub trait Fake { header_params: models::TestEnumParametersHeaderParams, query_params: models::TestEnumParametersQueryParams, body: Option, - ) -> Result; + ) -> Result; /// test inline additionalProperties. /// @@ -234,7 +234,7 @@ pub trait Fake { host: Host, cookies: CookieJar, body: std::collections::HashMap, - ) -> Result; + ) -> Result; /// test json serialization of form data. /// @@ -245,5 +245,5 @@ pub trait Fake { host: Host, cookies: CookieJar, body: models::TestJsonFormDataRequest, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs index dbc5f4b6184f..100f9dc7ad59 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs @@ -28,5 +28,5 @@ pub trait FakeClassnameTags123 { host: Host, cookies: CookieJar, body: models::Client, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs index 169b621ede09..05bb94bdfe44 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs @@ -96,7 +96,7 @@ pub trait Pet { host: Host, cookies: CookieJar, body: models::Pet, - ) -> Result; + ) -> Result; /// Deletes a pet. /// @@ -108,7 +108,7 @@ pub trait Pet { cookies: CookieJar, header_params: models::DeletePetHeaderParams, path_params: models::DeletePetPathParams, - ) -> Result; + ) -> Result; /// Finds Pets by status. /// @@ -119,7 +119,7 @@ pub trait Pet { host: Host, cookies: CookieJar, query_params: models::FindPetsByStatusQueryParams, - ) -> Result; + ) -> Result; /// Finds Pets by tags. /// @@ -130,7 +130,7 @@ pub trait Pet { host: Host, cookies: CookieJar, query_params: models::FindPetsByTagsQueryParams, - ) -> Result; + ) -> Result; /// Find pet by ID. /// @@ -142,7 +142,7 @@ pub trait Pet { cookies: CookieJar, token_in_header: Option, path_params: models::GetPetByIdPathParams, - ) -> Result; + ) -> Result; /// Update an existing pet. /// @@ -153,7 +153,7 @@ pub trait Pet { host: Host, cookies: CookieJar, body: models::Pet, - ) -> Result; + ) -> Result; /// Updates a pet in the store with form data. /// @@ -165,7 +165,7 @@ pub trait Pet { cookies: CookieJar, path_params: models::UpdatePetWithFormPathParams, body: Option, - ) -> Result; + ) -> Result; /// uploads an image. /// @@ -177,5 +177,5 @@ pub trait Pet { cookies: CookieJar, path_params: models::UploadFilePathParams, body: Multipart, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs index 3616cc511a32..371f49d4ebe2 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs @@ -60,7 +60,7 @@ pub trait Store { host: Host, cookies: CookieJar, path_params: models::DeleteOrderPathParams, - ) -> Result; + ) -> Result; /// Returns pet inventories by status. /// @@ -71,7 +71,7 @@ pub trait Store { host: Host, cookies: CookieJar, token_in_header: Option, - ) -> Result; + ) -> Result; /// Find purchase order by ID. /// @@ -82,7 +82,7 @@ pub trait Store { host: Host, cookies: CookieJar, path_params: models::GetOrderByIdPathParams, - ) -> Result; + ) -> Result; /// Place an order for a pet. /// @@ -93,5 +93,5 @@ pub trait Store { host: Host, cookies: CookieJar, body: models::Order, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs index ba3e68d8424d..1aa623644320 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs @@ -98,7 +98,7 @@ pub trait User { host: Host, cookies: CookieJar, body: models::User, - ) -> Result; + ) -> Result; /// Creates list of users with given input array. /// @@ -109,7 +109,7 @@ pub trait User { host: Host, cookies: CookieJar, body: Vec, - ) -> Result; + ) -> Result; /// Creates list of users with given input array. /// @@ -120,7 +120,7 @@ pub trait User { host: Host, cookies: CookieJar, body: Vec, - ) -> Result; + ) -> Result; /// Delete user. /// @@ -131,7 +131,7 @@ pub trait User { host: Host, cookies: CookieJar, path_params: models::DeleteUserPathParams, - ) -> Result; + ) -> Result; /// Get user by user name. /// @@ -142,7 +142,7 @@ pub trait User { host: Host, cookies: CookieJar, path_params: models::GetUserByNamePathParams, - ) -> Result; + ) -> Result; /// Logs user into the system. /// @@ -153,7 +153,7 @@ pub trait User { host: Host, cookies: CookieJar, query_params: models::LoginUserQueryParams, - ) -> Result; + ) -> Result; /// Logs out current logged in user session. /// @@ -163,7 +163,7 @@ pub trait User { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Updated user. /// @@ -175,5 +175,5 @@ pub trait User { cookies: CookieJar, path_params: models::UpdateUserPathParams, body: models::User, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs index 92335fa4400c..bedaffceeb74 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs @@ -100,7 +100,7 @@ pub trait Pet { host: Host, cookies: CookieJar, body: models::Pet, - ) -> Result; + ) -> Result; /// Deletes a pet. /// @@ -112,7 +112,7 @@ pub trait Pet { cookies: CookieJar, header_params: models::DeletePetHeaderParams, path_params: models::DeletePetPathParams, - ) -> Result; + ) -> Result; /// Finds Pets by status. /// @@ -123,7 +123,7 @@ pub trait Pet { host: Host, cookies: CookieJar, query_params: models::FindPetsByStatusQueryParams, - ) -> Result; + ) -> Result; /// Finds Pets by tags. /// @@ -134,7 +134,7 @@ pub trait Pet { host: Host, cookies: CookieJar, query_params: models::FindPetsByTagsQueryParams, - ) -> Result; + ) -> Result; /// Find pet by ID. /// @@ -146,7 +146,7 @@ pub trait Pet { cookies: CookieJar, token_in_header: Option, path_params: models::GetPetByIdPathParams, - ) -> Result; + ) -> Result; /// Update an existing pet. /// @@ -157,7 +157,7 @@ pub trait Pet { host: Host, cookies: CookieJar, body: models::Pet, - ) -> Result; + ) -> Result; /// Updates a pet in the store with form data. /// @@ -169,7 +169,7 @@ pub trait Pet { cookies: CookieJar, path_params: models::UpdatePetWithFormPathParams, body: Option, - ) -> Result; + ) -> Result; /// uploads an image. /// @@ -181,5 +181,5 @@ pub trait Pet { cookies: CookieJar, path_params: models::UploadFilePathParams, body: Multipart, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs index 85093df815ba..555aba9d894e 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs @@ -60,7 +60,7 @@ pub trait Store { host: Host, cookies: CookieJar, path_params: models::DeleteOrderPathParams, - ) -> Result; + ) -> Result; /// Returns pet inventories by status. /// @@ -71,7 +71,7 @@ pub trait Store { host: Host, cookies: CookieJar, token_in_header: Option, - ) -> Result; + ) -> Result; /// Find purchase order by ID. /// @@ -82,7 +82,7 @@ pub trait Store { host: Host, cookies: CookieJar, path_params: models::GetOrderByIdPathParams, - ) -> Result; + ) -> Result; /// Place an order for a pet. /// @@ -93,5 +93,5 @@ pub trait Store { host: Host, cookies: CookieJar, body: models::Order, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs index 3d8846495695..ae7a2373f196 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs @@ -100,7 +100,7 @@ pub trait User { cookies: CookieJar, token_in_header: Option, body: models::User, - ) -> Result; + ) -> Result; /// Creates list of users with given input array. /// @@ -112,7 +112,7 @@ pub trait User { cookies: CookieJar, token_in_header: Option, body: Vec, - ) -> Result; + ) -> Result; /// Creates list of users with given input array. /// @@ -124,7 +124,7 @@ pub trait User { cookies: CookieJar, token_in_header: Option, body: Vec, - ) -> Result; + ) -> Result; /// Delete user. /// @@ -136,7 +136,7 @@ pub trait User { cookies: CookieJar, token_in_header: Option, path_params: models::DeleteUserPathParams, - ) -> Result; + ) -> Result; /// Get user by user name. /// @@ -147,7 +147,7 @@ pub trait User { host: Host, cookies: CookieJar, path_params: models::GetUserByNamePathParams, - ) -> Result; + ) -> Result; /// Logs user into the system. /// @@ -158,7 +158,7 @@ pub trait User { host: Host, cookies: CookieJar, query_params: models::LoginUserQueryParams, - ) -> Result; + ) -> Result; /// Logs out current logged in user session. /// @@ -169,7 +169,7 @@ pub trait User { host: Host, cookies: CookieJar, token_in_header: Option, - ) -> Result; + ) -> Result; /// Updated user. /// @@ -182,5 +182,5 @@ pub trait User { token_in_header: Option, path_params: models::UpdateUserPathParams, body: models::User, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs index 3608ffa65572..cfb12ef7fd4d 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs @@ -25,5 +25,5 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs index cd590f6819ac..2c6c51c0d2c3 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs @@ -26,5 +26,5 @@ pub trait Default { host: Host, cookies: CookieJar, header_params: models::UsersPostHeaderParams, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs index 08985bd64e59..ba643a1d2f82 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs @@ -89,7 +89,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// A dummy endpoint to make the spec valid.. /// @@ -99,7 +99,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// DummyPut - PUT /dummy async fn dummy_put( @@ -108,7 +108,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: models::FooDummyPutRequest, - ) -> Result; + ) -> Result; /// Get a file. /// @@ -118,7 +118,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// GetStructuredYaml - GET /get-structured-yaml async fn get_structured_yaml( @@ -126,7 +126,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Test HTML handling. /// @@ -137,7 +137,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: String, - ) -> Result; + ) -> Result; /// PostYaml - POST /post-yaml async fn post_yaml( @@ -146,7 +146,7 @@ pub trait Default { host: Host, cookies: CookieJar, body: String, - ) -> Result; + ) -> Result; /// Get an arbitrary JSON blob.. /// @@ -156,7 +156,7 @@ pub trait Default { method: Method, host: Host, cookies: CookieJar, - ) -> Result; + ) -> Result; /// Send an arbitrary JSON blob. /// @@ -167,5 +167,5 @@ pub trait Default { host: Host, cookies: CookieJar, body: crate::types::Object, - ) -> Result; + ) -> Result; } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs index a5b9394198a1..d9ef3904a0ca 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs @@ -26,5 +26,5 @@ pub trait Default { host: Host, cookies: CookieJar, body: models::Email, - ) -> Result; + ) -> Result; }