Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoria-Casasampere-BeeTheData committed Feb 10, 2025
1 parent b512684 commit a181f49
Show file tree
Hide file tree
Showing 54 changed files with 0 additions and 5,992 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,9 @@ where
{{/disableValidator}}

let result = api_impl.as_ref().{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}(
<<<<<<< HEAD
<<<<<<< HEAD
&method,
&host,
&cookies,
=======
method.clone(),
host.clone(),
cookies.clone(),
>>>>>>> 00e7ad2ac29 (Pass in method, host and cookies to error handler)
=======
&method,
&host,
&cookies,
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
{{#vendorExtensions}}
{{#x-has-auth-methods}}
&claims,
Expand Down
10 changes: 0 additions & 10 deletions samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@ conversion = [

[dependencies]
async-trait = "0.1"
<<<<<<< HEAD
<<<<<<< HEAD
axum = { version = "0.8", features = ["multipart"] }
axum-extra = { version = "0.10", features = ["cookie"] }
=======
axum = "0.8"
axum-extra = { version = "0.10", features = ["cookie", "multipart"] }
>>>>>>> fb7dae12a7d (Update axum to 0.8)
=======
axum = { version = "0.8", features = ["multipart"] }
axum-extra = { version = "0.10", features = ["cookie"] }
>>>>>>> 47c0a58c968 (Multipart is also part of the axum update)
base64 = "0.22"
bytes = "1"
chrono = { version = "0.4", features = ["serde"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,10 @@ pub trait ApiAuthBasic {
// Error handler for unhandled errors.
#[async_trait::async_trait]
pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 00e7ad2ac29 (Pass in method, host and cookies to error handler)
#[allow(unused_variables)]
#[tracing::instrument(skip_all)]
async fn handle_error(
&self,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 46691510f63 (Update deps)
=======
>>>>>>> 73be82180e8 (Rebase rust-axum-error-handling)
method: &::http::Method,
host: &axum_extra::extract::Host,
cookies: &axum_extra::extract::CookieJar,
Expand All @@ -75,25 +63,6 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
tracing::error!("Unhandled error: {:?}", error);
axum::response::Response::builder()
.status(http::StatusCode::INTERNAL_SERVER_ERROR)
=======
#[tracing::instrument(skip(self))]
async fn handle_error(&self, error: E) -> Result<axum::response::Response, http::StatusCode> {
=======
method: ::http::Method,
host: axum_extra::extract::Host,
cookies: axum_extra::extract::CookieJar,
=======
method: &::http::Method,
host: &axum_extra::extract::Host,
cookies: &axum_extra::extract::CookieJar,
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
error: E,
) -> Result<axum::response::Response, http::StatusCode> {
>>>>>>> 00e7ad2ac29 (Pass in method, host and cookies to error handler)
tracing::error!("Unhandled error: {:?}", error);
axum::response::Response::builder()
.status(500)
>>>>>>> 9841fa4dc2c (Implement a custom error handler for unhandled or generic endpoint errors)
.body(axum::body::Body::empty())
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
use async_trait::async_trait;
use axum::extract::*;
<<<<<<< HEAD
<<<<<<< HEAD
use axum_extra::extract::{CookieJar, Host};
=======
use axum_extra::extract::{CookieJar, Host, Multipart};
>>>>>>> fb7dae12a7d (Update axum to 0.8)
=======
use axum_extra::extract::{CookieJar, Host};
>>>>>>> 47c0a58c968 (Multipart is also part of the axum update)
use bytes::Bytes;
use http::Method;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -56,104 +48,33 @@ pub trait Payments<E: std::fmt::Debug + Send + Sync + 'static = ()>:
/// GetPaymentMethodById - GET /v71/paymentMethods/{id}
async fn get_payment_method_by_id(
&self,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
=======
>>>>>>> a297ccec6f8 (Rebase error handler)
=======
>>>>>>> 73be82180e8 (Rebase rust-axum-error-handling)
method: &Method,
host: &Host,
cookies: &CookieJar,
claims: &Self::Claims,
path_params: &models::GetPaymentMethodByIdPathParams,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> a297ccec6f8 (Rebase error handler)
=======
method: Method,
host: Host,
cookies: CookieJar,
<<<<<<< HEAD
path_params: models::GetPaymentMethodByIdPathParams,
>>>>>>> 9841fa4dc2c (Implement a custom error handler for unhandled or generic endpoint errors)
=======
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
=======
claims: Self::Claims,
path_params: models::GetPaymentMethodByIdPathParams,
>>>>>>> ba70bfea1e1 (Implement basic and bearer auth handling)
>>>>>>> a297ccec6f8 (Rebase error handler)
=======
>>>>>>> 73be82180e8 (Rebase rust-axum-error-handling)
) -> Result<GetPaymentMethodByIdResponse, E>;

/// Get payment methods.
///
/// GetPaymentMethods - GET /v71/paymentMethods
async fn get_payment_methods(
&self,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> a297ccec6f8 (Rebase error handler)
method: &Method,
host: &Host,
cookies: &CookieJar,
=======
method: Method,
host: Host,
cookies: CookieJar,
<<<<<<< HEAD
>>>>>>> 9841fa4dc2c (Implement a custom error handler for unhandled or generic endpoint errors)
=======
method: &Method,
host: &Host,
cookies: &CookieJar,
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
=======
claims: Self::Claims,
>>>>>>> ba70bfea1e1 (Implement basic and bearer auth handling)
>>>>>>> a297ccec6f8 (Rebase error handler)
=======
method: &Method,
host: &Host,
cookies: &CookieJar,
claims: &Self::Claims,
>>>>>>> 73be82180e8 (Rebase rust-axum-error-handling)
) -> Result<GetPaymentMethodsResponse, E>;

/// Make a payment.
///
/// PostMakePayment - POST /v71/payments
async fn post_make_payment(
&self,
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
method: &Method,
host: &Host,
cookies: &CookieJar,
claims: &Self::Claims,
body: &Option<models::Payment>,
<<<<<<< HEAD
=======
method: Method,
host: Host,
cookies: CookieJar,
claims: Self::Claims,
body: Option<models::Payment>,
>>>>>>> 9841fa4dc2c (Implement a custom error handler for unhandled or generic endpoint errors)
=======
>>>>>>> 3d833fd5ff9 (Make API methods take references instead of ownership)
) -> Result<PostMakePaymentResponse, E>;
}
Loading

0 comments on commit a181f49

Please sign in to comment.