mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 22:58:34 +01:00
docs(schema): add cmd to generate notification schema
This commit is contained in:
1 parent
8a17e0ad00
commit
20c3bbd9a1
4 files changed
+20
-2
No files matched your search
@@ -1,4 +1,5 @@
|
||||
pub use komorebi::DATA_DIR;
|
||||
pub use komorebi::Notification;
|
||||
pub use komorebi::core::ApplicationIdentifier;
|
||||
pub use komorebi::core::MoveBehaviour;
|
||||
pub use komorebi::core::OperationBehaviour;
|
||||
|
||||
@@ -403,7 +403,7 @@ pub enum SocketMessage {
|
||||
// AddSubscriberPipe(String),
|
||||
// RemoveSubscriberPipe(String),
|
||||
ApplicationSpecificConfigurationSchema,
|
||||
// NotificationSchema,
|
||||
NotificationSchema,
|
||||
SocketSchema,
|
||||
StaticConfigSchema,
|
||||
// GenerateStaticConfig,
|
||||
|
||||
@@ -1422,6 +1422,15 @@ impl WindowManager {
|
||||
reply.write_all(schema.as_bytes())?;
|
||||
}
|
||||
}
|
||||
SocketMessage::NotificationSchema => {
|
||||
#[cfg(feature = "schemars")]
|
||||
{
|
||||
let notification = schemars::schema_for!(Notification);
|
||||
let schema = serde_json::to_string_pretty(¬ification)?;
|
||||
|
||||
reply.write_all(schema.as_bytes())?;
|
||||
}
|
||||
}
|
||||
SocketMessage::SocketSchema => {
|
||||
#[cfg(feature = "schemars")]
|
||||
{
|
||||
|
||||
@@ -1087,7 +1087,7 @@ enum SubCommand {
|
||||
#[clap(alias = "asc-schema")]
|
||||
ApplicationSpecificConfigurationSchema,
|
||||
/// Generate a JSON Schema of subscription notifications
|
||||
// NotificationSchema,
|
||||
NotificationSchema,
|
||||
/// Generate a JSON Schema of socket messages
|
||||
SocketSchema,
|
||||
/// Generate a JSON Schema of the static configuration file
|
||||
@@ -1710,6 +1710,14 @@ fn main() -> eyre::Result<()> {
|
||||
println!("{schema}");
|
||||
}
|
||||
}
|
||||
SubCommand::NotificationSchema => {
|
||||
#[cfg(feature = "schemars")]
|
||||
{
|
||||
let notification = schemars::schema_for!(komorebi_client::Notification);
|
||||
let schema = serde_json::to_string_pretty(¬ification)?;
|
||||
println!("{schema}");
|
||||
}
|
||||
}
|
||||
SubCommand::SocketSchema => {
|
||||
#[cfg(feature = "schemars")]
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user