arri_repr/
ref.rs

1use ronky_derive::Serializable as SerializableDerive;
2
3/// Represents a reference schema in an Arri schema.
4///
5/// This struct is used to define a reference to another schema.
6#[derive(Default, Debug, PartialEq, Eq, SerializableDerive)]
7#[arri_disable(metadata, nullable)]
8pub struct RefSchema {
9    /// The reference string pointing to another schema.
10    pub r#ref: String,
11}
12
13impl RefSchema {
14    /// Creates a new `RefSchema` instance.
15    ///
16    /// # Arguments
17    ///
18    /// * `r#ref` - A value that can be converted to a string, representing the reference.
19    ///
20    /// # Returns
21    ///
22    /// A new `RefSchema` instance.
23    pub fn new(r#ref: impl ToString) -> Self {
24        Self {
25            r#ref: r#ref.to_string(),
26        }
27    }
28}