submissions-api: openapi expects optional fields to be omitted
All checks were successful
continuous-integration/drone/push Build is passing

The default serde configuration is to serialize optional values as "null"
This commit is contained in:
Quaternions 2024-12-19 17:48:58 -08:00
parent a511246d78
commit ca846972c1

View File

@ -74,9 +74,13 @@ pub struct GetScriptRequest{
pub struct GetScriptsRequest<'a>{
pub Page:u32,
pub Limit:u32,
#[serde(skip_serializing_if="Option::is_none")]
pub Name:Option<&'a str>,
#[serde(skip_serializing_if="Option::is_none")]
pub Hash:Option<&'a str>,
#[serde(skip_serializing_if="Option::is_none")]
pub Source:Option<&'a str>,
#[serde(skip_serializing_if="Option::is_none")]
pub SubmissionID:Option<i64>,
}
pub struct HashRequest<'a>{
@ -96,6 +100,7 @@ pub struct ScriptResponse{
pub struct CreateScriptRequest<'a>{
pub Name:&'a str,
pub Source:&'a str,
#[serde(skip_serializing_if="Option::is_none")]
pub SubmissionID:Option<i64>,
}
#[allow(nonstandard_style)]
@ -119,8 +124,11 @@ pub enum Policy{
pub struct GetScriptPoliciesRequest<'a>{
pub Page:u32,
pub Limit:u32,
#[serde(skip_serializing_if="Option::is_none")]
pub FromScriptHash:Option<&'a str>,
#[serde(skip_serializing_if="Option::is_none")]
pub ToScriptID:Option<ScriptID>,
#[serde(skip_serializing_if="Option::is_none")]
pub Policy:Option<Policy>,
}
#[allow(nonstandard_style)]
@ -148,8 +156,11 @@ pub struct ScriptPolicyIDResponse{
#[derive(serde::Serialize)]
pub struct UpdateScriptPolicyRequest{
pub ScriptPolicyID:ScriptPolicyID,
#[serde(skip_serializing_if="Option::is_none")]
pub FromScriptID:Option<ScriptID>,
#[serde(skip_serializing_if="Option::is_none")]
pub ToScriptID:Option<ScriptID>,
#[serde(skip_serializing_if="Option::is_none")]
pub Policy:Option<Policy>,
}