From 5d1e6622cb819fbbf81e02da93281d1dfb799f41 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 1 Jun 2026 17:39:00 -0500 Subject: [PATCH] add description information to params for modules --- internal/module/db-sqlite.go | 6 ++-- internal/module/http-server.go | 9 +++--- internal/module/midi-input.go | 5 ++-- internal/module/midi-output.go | 5 ++-- internal/module/mqtt-client.go | 33 ++++++++++++---------- internal/module/nats-client.go | 10 ++++--- internal/module/nats-server.go | 18 ++++++------ internal/module/redis-client.go | 12 +++++--- internal/module/serial-client.go | 17 +++++++----- internal/module/sip-call-server.go | 34 +++++++++++++---------- internal/module/sip-dtmf-server.go | 43 ++++++++++++++++------------- internal/module/tcp-client.go | 21 ++++++++------ internal/module/tcp-server.go | 23 ++++++++------- internal/module/time-interval.go | 2 +- internal/module/time-timer.go | 2 +- internal/module/udp-client.go | 14 ++++++---- internal/module/udp-multicast.go | 14 ++++++---- internal/module/udp-server.go | 27 ++++++++++-------- internal/module/websocket-client.go | 5 ++-- 19 files changed, 172 insertions(+), 128 deletions(-) diff --git a/internal/module/db-sqlite.go b/internal/module/db-sqlite.go index 468545e..f986d79 100644 --- a/internal/module/db-sqlite.go +++ b/internal/module/db-sqlite.go @@ -22,8 +22,10 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "dsn": { - Type: "string", - MinLength: new(1), + Title: "Data Source Name", + Description: "the data source name (DSN) for the SQLite database", + Type: "string", + MinLength: new(1), }, }, Required: []string{"dsn"}, diff --git a/internal/module/http-server.go b/internal/module/http-server.go index 9845e89..133240b 100644 --- a/internal/module/http-server.go +++ b/internal/module/http-server.go @@ -24,10 +24,11 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port for the HTTP server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), }, }, Required: []string{"port"}, diff --git a/internal/module/midi-input.go b/internal/module/midi-input.go index 4a64a2d..8d5c3cf 100644 --- a/internal/module/midi-input.go +++ b/internal/module/midi-input.go @@ -22,8 +22,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "port": { - Title: "Port", - Type: "string", + Title: "Port", + Description: "the name of the MIDI port to listen to", + Type: "string", }, }, Required: []string{"port"}, diff --git a/internal/module/midi-output.go b/internal/module/midi-output.go index 24250a4..fa4b75d 100644 --- a/internal/module/midi-output.go +++ b/internal/module/midi-output.go @@ -24,8 +24,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "port": { - Title: "Port", - Type: "string", + Title: "Port", + Description: "the name of the MIDI port to send messages to", + Type: "string", }, }, Required: []string{"port"}, diff --git a/internal/module/mqtt-client.go b/internal/module/mqtt-client.go index 03abd33..081185b 100644 --- a/internal/module/mqtt-client.go +++ b/internal/module/mqtt-client.go @@ -22,28 +22,33 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "broker": { - Title: "Broker URL", - Type: "string", + Title: "Broker URL", + Description: "the URL of the MQTT broker to connect to", + Type: "string", }, "topic": { - Title: "Topic", - Type: "string", + Title: "Topic", + Description: "an MQTT topic to subscribe to", + Type: "string", }, "clientId": { - Title: "Client ID", - Type: "string", + Title: "Client ID", + Description: "the client ID to use when connecting to the MQTT broker", + Type: "string", }, "qos": { - Title: "QoS", - Type: "integer", - Minimum: jsonschema.Ptr[float64](0), - Maximum: jsonschema.Ptr[float64](2), - Default: json.RawMessage(`0`), + Title: "QoS", + Description: "the QoS level to use when publishing messages", + Type: "integer", + Minimum: jsonschema.Ptr[float64](0), + Maximum: jsonschema.Ptr[float64](2), + Default: json.RawMessage(`0`), }, "retained": { - Title: "Retained", - Type: "boolean", - Default: json.RawMessage(`false`), + Title: "Retained", + Description: "whether to set the retained flag when publishing messages", + Type: "boolean", + Default: json.RawMessage(`false`), }, }, Required: []string{"broker", "topic", "clientId"}, diff --git a/internal/module/nats-client.go b/internal/module/nats-client.go index 2d4a099..9e689f0 100644 --- a/internal/module/nats-client.go +++ b/internal/module/nats-client.go @@ -20,12 +20,14 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "url": { - Title: "NATS Server URL", - Type: "string", + Title: "NATS Server URL", + Description: "the URL of the NATS server to connect to", + Type: "string", }, "subject": { - Title: "Subject", - Type: "string", + Title: "Subject", + Description: "the subject to subscribe to", + Type: "string", }, }, Required: []string{"url", "subject"}, diff --git a/internal/module/nats-server.go b/internal/module/nats-server.go index 592d0c6..1092613 100644 --- a/internal/module/nats-server.go +++ b/internal/module/nats-server.go @@ -24,16 +24,18 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", - Default: json.RawMessage(`"0.0.0.0"`), + Title: "IP", + Description: "the IP address to bind the NATS server to", + Type: "string", + Default: json.RawMessage(`"0.0.0.0"`), }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), - Default: json.RawMessage(`4222`), + Title: "Port", + Description: "the port for the NATS server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), + Default: json.RawMessage(`4222`), }, }, Required: []string{}, diff --git a/internal/module/redis-client.go b/internal/module/redis-client.go index a675778..6c8e3d2 100644 --- a/internal/module/redis-client.go +++ b/internal/module/redis-client.go @@ -21,12 +21,16 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "host": { - Type: "string", + Title: "Host", + Description: "the hostname or IP address of the Redis server to connect to", + Type: "string", }, "port": { - Type: "integer", - Minimum: jsonschema.Ptr[float64](1), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port to use when connecting to the Redis server", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1), + Maximum: jsonschema.Ptr[float64](65535), }, }, Required: []string{"host", "port"}, diff --git a/internal/module/serial-client.go b/internal/module/serial-client.go index 1801a46..9d9eb4e 100644 --- a/internal/module/serial-client.go +++ b/internal/module/serial-client.go @@ -25,17 +25,20 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "port": { - Title: "Port", - Type: "string", + Title: "Port", + Description: "the name of the serial port to connect to", + Type: "string", }, "baudRate": { - Title: "Baud Rate", - Type: "integer", + Title: "Baud Rate", + Description: "the baud rate to use when connecting to the serial port", + Type: "integer", }, "framing": { - Title: "Framing Method", - Type: "string", - Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, + Title: "Framing Method", + Description: "the method to use for framing messages on the serial port", + Type: "string", + Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, }, }, Required: []string{"port", "baudRate", "framing"}, diff --git a/internal/module/sip-call-server.go b/internal/module/sip-call-server.go index 73a7572..0f3a7ab 100644 --- a/internal/module/sip-call-server.go +++ b/internal/module/sip-call-server.go @@ -29,27 +29,31 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", - Default: json.RawMessage(`"0.0.0.0"`), + Title: "IP", + Description: "the IP address to bind the SIP server to", + Type: "string", + Default: json.RawMessage(`"0.0.0.0"`), }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), - Default: json.RawMessage(`5060`), + Title: "Port", + Description: "the port for the SIP server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), + Default: json.RawMessage(`5060`), }, "transport": { - Title: "Transport", - Type: "string", - Enum: []any{"udp", "tcp", "ws", "udp4", "tcp4"}, - Default: json.RawMessage(`"udp"`), + Title: "Transport", + Description: "the transport protocol to use for the SIP server", + Type: "string", + Enum: []any{"udp", "tcp", "ws", "udp4", "tcp4"}, + Default: json.RawMessage(`"udp"`), }, "userAgent": { - Title: "User Agent", - Type: "string", - Default: json.RawMessage(`"showbridge"`), + Title: "User Agent", + Description: "the user agent string to use", + Type: "string", + Default: json.RawMessage(`"showbridge"`), }, }, Required: []string{}, diff --git a/internal/module/sip-dtmf-server.go b/internal/module/sip-dtmf-server.go index a73a167..ffa4003 100644 --- a/internal/module/sip-dtmf-server.go +++ b/internal/module/sip-dtmf-server.go @@ -30,33 +30,38 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", - Default: json.RawMessage(`"0.0.0.0"`), + Title: "IP", + Description: "the IP address to bind the SIP server to", + Type: "string", + Default: json.RawMessage(`"0.0.0.0"`), }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), - Default: json.RawMessage(`5060`), + Title: "Port", + Description: "the port for the SIP server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), + Default: json.RawMessage(`5060`), }, "transport": { - Title: "Transport", - Type: "string", - Enum: []any{"udp", "tcp", "ws", "udp4", "tcp4"}, - Default: json.RawMessage(`"udp"`), + Title: "Transport", + Description: "the transport protocol to use for the SIP server", + Type: "string", + Enum: []any{"udp", "tcp", "ws", "udp4", "tcp4"}, + Default: json.RawMessage(`"udp"`), }, "userAgent": { - Title: "User Agent", - Type: "string", - Default: json.RawMessage(`"showbridge"`), + Title: "User Agent", + Description: "the user agent string to use", + Type: "string", + Default: json.RawMessage(`"showbridge"`), }, "separator": { - Title: "DTMF Separator", - Type: "string", - MinLength: new(1), - MaxLength: new(1), + Title: "DTMF Separator", + Description: "the DTMF character to use as a separator between DTMF digit groups", + Type: "string", + MinLength: new(1), + MaxLength: new(1), }, }, Required: []string{"separator"}, diff --git a/internal/module/tcp-client.go b/internal/module/tcp-client.go index 126ae54..425b84f 100644 --- a/internal/module/tcp-client.go +++ b/internal/module/tcp-client.go @@ -23,19 +23,22 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "host": { - Title: "Host", - Type: "string", + Title: "Host", + Description: "the hostname or IP address of the TCP server to connect to", + Type: "string", }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port of the TCP server to connect to", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1), + Maximum: jsonschema.Ptr[float64](65535), }, "framing": { - Title: "Framing Method", - Type: "string", - Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, + Title: "Framing Method", + Description: "the method used to frame messages over the TCP connection", + Type: "string", + Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, }, }, Required: []string{"host", "port", "framing"}, diff --git a/internal/module/tcp-server.go b/internal/module/tcp-server.go index 061cc81..9143b52 100644 --- a/internal/module/tcp-server.go +++ b/internal/module/tcp-server.go @@ -26,20 +26,23 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", - Default: json.RawMessage(`"0.0.0.0"`), + Title: "IP", + Description: "the IP address to bind the TCP server to", + Type: "string", + Default: json.RawMessage(`"0.0.0.0"`), }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port for the TCP server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), }, "framing": { - Title: "Framing Method", - Type: "string", - Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, + Title: "Framing Method", + Description: "the method used to frame messages over the TCP connection", + Type: "string", + Enum: []any{"LF", "CR", "CRLF", "SLIP", "RAW"}, }, }, Required: []string{"port", "framing"}, diff --git a/internal/module/time-interval.go b/internal/module/time-interval.go index 723b2f4..1a03ede 100644 --- a/internal/module/time-interval.go +++ b/internal/module/time-interval.go @@ -20,8 +20,8 @@ func init() { Properties: map[string]*jsonschema.Schema{ "duration": { Title: "Duration", + Description: "time in milliseconds between emitted events", Type: "integer", - Description: "Interval duration in milliseconds", }, }, Required: []string{"duration"}, diff --git a/internal/module/time-timer.go b/internal/module/time-timer.go index cef7bac..d2bb75b 100644 --- a/internal/module/time-timer.go +++ b/internal/module/time-timer.go @@ -20,8 +20,8 @@ func init() { Properties: map[string]*jsonschema.Schema{ "duration": { Title: "Duration", + Description: "time in milliseconds before the timer fires", Type: "integer", - Description: "Interval duration in milliseconds", }, }, Required: []string{"duration"}, diff --git a/internal/module/udp-client.go b/internal/module/udp-client.go index 89c7da6..9069746 100644 --- a/internal/module/udp-client.go +++ b/internal/module/udp-client.go @@ -21,14 +21,16 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "host": { - Title: "Host", - Type: "string", + Title: "Host", + Description: "the hostname or IP address of the UDP server to connect to", + Type: "string", }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port of the UDP server to connect to", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1), + Maximum: jsonschema.Ptr[float64](65535), }, }, Required: []string{"host", "port"}, diff --git a/internal/module/udp-multicast.go b/internal/module/udp-multicast.go index 8c9de48..bdeb7d1 100644 --- a/internal/module/udp-multicast.go +++ b/internal/module/udp-multicast.go @@ -22,14 +22,16 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", + Title: "IP", + Description: "the multicast address to listen on", + Type: "string", }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), }, }, Required: []string{"ip", "port"}, diff --git a/internal/module/udp-server.go b/internal/module/udp-server.go index 0b316be..d54d554 100644 --- a/internal/module/udp-server.go +++ b/internal/module/udp-server.go @@ -23,22 +23,25 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "ip": { - Title: "IP", - Type: "string", - Default: json.RawMessage(`"0.0.0.0"`), + Title: "IP", + Description: "the IP address to bind the UDP server to", + Type: "string", + Default: json.RawMessage(`"0.0.0.0"`), }, "port": { - Title: "Port", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1024), - Maximum: jsonschema.Ptr[float64](65535), + Title: "Port", + Description: "the port for the UDP server to listen on", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1024), + Maximum: jsonschema.Ptr[float64](65535), }, "bufferSize": { - Title: "Buffer Size", - Type: "integer", - Minimum: jsonschema.Ptr[float64](1), - Maximum: jsonschema.Ptr[float64](65535), - Default: json.RawMessage("2048"), + Title: "Buffer Size", + Description: "the size of the buffer for incoming UDP messages", + Type: "integer", + Minimum: jsonschema.Ptr[float64](1), + Maximum: jsonschema.Ptr[float64](65535), + Default: json.RawMessage("2048"), }, }, Required: []string{"port"}, diff --git a/internal/module/websocket-client.go b/internal/module/websocket-client.go index e2b545f..2851985 100644 --- a/internal/module/websocket-client.go +++ b/internal/module/websocket-client.go @@ -23,8 +23,9 @@ func init() { Type: "object", Properties: map[string]*jsonschema.Schema{ "url": { - Title: "URL", - Type: "string", + Title: "URL", + Description: "the URL of the WebSocket server to connect", + Type: "string", }, }, Required: []string{"url"},