Skip to content

Commit

Permalink
Mark NameOrCurrent as an untagged enum
Browse files Browse the repository at this point in the history
This changes the required syntax when defining validation rules to be as
documented in the examples.

Expected (works with this change):

    - allow: AlterExistingFiles
      packages:
        - automake

Reality (before this change):

    - allow: AlterExistingFiles
      packages:
        - !Name automake

Signed-off-by: J Robert Ray <jrray@imageworks.com>
  • Loading branch information
J Robert Ray committed Apr 16, 2024
1 parent 3539322 commit 9473f12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/spk-schema/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ pub enum FileAlteration {

/// Either a package name or a special reference to the current package
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd, Deserialize, Serialize)]
#[serde(untagged)]
pub enum NameOrCurrent {
#[serde(rename = "Self")]
Current,
Expand Down

0 comments on commit 9473f12

Please sign in to comment.