radicle: fix to schemars of DefaultSeedingPolicy
Use `flatten` to remove the extraneous `Scope2` that shows up in the JSON schema of the Radicle `Config`.
This commit is contained in:
parent
6291cae592
commit
7c92360842
|
|
@ -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": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue