Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle: fix to schemars of DefaultSeedingPolicy
Fintan Halpenny committed 1 month ago
commit 7c9236084237718cb3a3b04be81a4151438b3e0c
parent 6291cae
2 files changed +10 -17
modified crates/radicle-cli/examples/rad-config.md
@@ -614,18 +614,21 @@ $ rad config schema
          "description": "Allow seeding.",
          "type": "object",
          "properties": {
-
            "scope": {
-
              "description": "Seeding scope.",
-
              "$ref": "#/$defs/Scope"
-
            },
            "default": {
              "type": "string",
              "const": "allow"
            }
          },
+
          "anyOf": [
+
            {
+
              "$ref": "#/$defs/Scope"
+
            },
+
            {
+
              "type": "null"
+
            }
+
          ],
          "required": [
-
            "default",
-
            "scope"
+
            "default"
          ]
        },
        {
@@ -644,17 +647,6 @@ $ rad config schema
      ]
    },
    "Scope": {
-
      "description": "[`Scope`] provides a schema for [`policy::Scope`], where the inner scope is/noptional. It is introduced to allow ease migration to a future/nversion of [`DefaultSeedingPolicy::Allow`], where no or different defaults/napply to [`DefaultSeedingPolicy::Allow::scope`].",
-
      "anyOf": [
-
        {
-
          "$ref": "#/$defs/Scope2"
-
        },
-
        {
-
          "type": "null"
-
        }
-
      ]
-
    },
-
    "Scope2": {
      "description": "Follow scope of a seeded repository.",
      "oneOf": [
        {
modified crates/radicle/src/node/config.rs
@@ -373,6 +373,7 @@ pub enum DefaultSeedingPolicy {
    Allow {
        /// Seeding scope.
        #[serde(skip_serializing_if = "Scope::is_implicit")]
+
        #[cfg_attr(feature = "schemars", schemars(flatten))]
        scope: Scope,
    },
    /// Block seeding.