fix(openapi): correct schema references and semantics for v1 openApi spec (#8127)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2025-06-20 18:21:27 +05:30
committed by GitHub
parent a721d90c6b
commit 02dee9c581
19 changed files with 305 additions and 483 deletions

View File

@ -7357,7 +7357,7 @@ pub enum ApplePaySessionResponse {
/// This is the common response most of the times
NoThirdPartySdk(NoThirdPartySdkSessionResponse),
/// This is for the empty session response
NoSessionResponse,
NoSessionResponse(NullObject),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]
@ -8953,3 +8953,30 @@ pub struct RecordAttemptErrorDetails {
/// A string indicating how to proceed with an network error if payment gateway provide one. This is used to understand the network error code better.
pub network_error_message: Option<String>,
}
#[derive(Debug, Clone, Eq, PartialEq, ToSchema)]
pub struct NullObject;
impl Serialize for NullObject {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_none()
}
}
#[cfg(test)]
mod null_object_test {
use serde_json;
use super::*;
#[allow(clippy::unwrap_used)]
#[test]
fn test_null_object_serialization() {
let null_object = NullObject;
let serialized = serde_json::to_string(&null_object).unwrap();
assert_eq!(serialized, "null");
}
}