forked from loafle/openapi-generator-original
[Rust Server] Preserve path provided in base path (#5555)
* Preserve path provided in base path * Update samples
This commit is contained in:
parent
28ea718004
commit
05ace4f43f
@ -23,7 +23,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -62,7 +62,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -54,7 +54,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -76,7 +76,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -90,7 +90,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -93,7 +93,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
@ -62,7 +62,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result<S
|
||||
|
||||
let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?;
|
||||
let port = uri.port_part().map(|x| format!(":{}", x)).unwrap_or_default();
|
||||
Ok(format!("{}://{}{}", scheme, host, port))
|
||||
Ok(format!("{}://{}{}{}", scheme, host, port, uri.path().trim_end_matches('/')))
|
||||
}
|
||||
|
||||
/// A client that implements the API by making HTTP calls out to a server.
|
||||
|
Loading…
x
Reference in New Issue
Block a user