make description optional

This commit is contained in:
Lucas Nogueira 2023-07-31 12:55:57 -03:00
parent e729a9c83f
commit f514d655b6
No known key found for this signature in database
GPG Key ID: 7C32FCA95C8C95D7
5 changed files with 12 additions and 8 deletions

View File

@ -25,7 +25,7 @@ pub fn set_manifest(mut manifest: Manifest) {
manifest.capabilities.push(Capability {
id: feature_capability_id,
component: None,
description: format!("Allows the {feature} functionality"),
description: Some(format!("Allows the {feature} functionality")),
features: vec![feature.clone()],
scope: Default::default(),
});

View File

@ -2272,7 +2272,6 @@
"type": "object",
"required": [
"capabilities",
"description",
"id",
"members"
],
@ -2283,7 +2282,10 @@
},
"description": {
"description": "Describes the namespace in a human readable format.",
"type": "string"
"type": [
"string",
"null"
]
},
"members": {
"description": "The windows that can use the configuration of this namespace.",

View File

@ -1932,7 +1932,7 @@ pub struct Namespace {
/// It is recommended to use `drop-` or `allow-` prefixes to ensure the rule can be easily categorized.
pub id: String,
/// Describes the namespace in a human readable format.
pub description: String,
pub description: Option<String>,
/// The windows that can use the configuration of this namespace.
pub members: Vec<String>,
/// List of capabilities attached to this namespace.
@ -2670,7 +2670,7 @@ mod build {
impl ToTokens for Namespace {
fn to_tokens(&self, tokens: &mut TokenStream) {
let id = str_lit(&self.id);
let description = str_lit(&self.description);
let description = opt_str_lit(self.description.as_ref());
let members = vec_lit(&self.members, str_lit);
let capabilities = vec_lit(&self.capabilities, str_lit);

View File

@ -44,7 +44,7 @@ pub struct Capability {
/// When no value is set, it referes to the application itself.
pub component: Option<String>,
/// Describes the capability in a human readable format.
pub description: String,
pub description: Option<String>,
/// List of features enabled by this capability.
#[serde(default)]
pub features: Vec<String>,

View File

@ -2272,7 +2272,6 @@
"type": "object",
"required": [
"capabilities",
"description",
"id",
"members"
],
@ -2283,7 +2282,10 @@
},
"description": {
"description": "Describes the namespace in a human readable format.",
"type": "string"
"type": [
"string",
"null"
]
},
"members": {
"description": "The windows that can use the configuration of this namespace.",