Skip to content

How to use default structs in my own spec? #1297

Closed Answered by benkeil
benkeil asked this question in Q&A
Discussion options

You must be logged in to vote

figured it out:

#[derive(Clone, Serialize, Deserialize, Debug, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct TaskOption {
    pub r#for: Vec<String>,
    #[schemars(skip_serializing, skip_deserializing)]
    pub env: Option<Vec<EnvVar>>,
    #[schemars(skip_serializing, skip_deserializing)]
    pub env_from: Option<Vec<EnvFromSource>>,
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benkeil
Comment options

Answer selected by benkeil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants