From 175ce4abcd12624f6545e2de80a21b4e9625dcea Mon Sep 17 00:00:00 2001 From: Alex Bucknall Date: Mon, 7 Sep 2026 15:40:59 +0100 Subject: [PATCH] feat: add -force to bypass request schema validation Add a -force flag to the notecard CLI that skips JSON schema validation of -req. Validation is opt-in via the BLUES environment variable and is warn-only, so -force suppresses the warning and, more usefully, skips the live schema fetches that initSchema performs -- helpful when working offline or against a request the published schema does not yet cover. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01T8F6xMAoAdBizsR7cUKc4F --- notecard/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notecard/main.go b/notecard/main.go index c9d003e..540d43d 100644 --- a/notecard/main.go +++ b/notecard/main.go @@ -68,6 +68,7 @@ func getFlagGroups() []lib.FlagGroup { lib.GetFlagByName("pretty"), lib.GetFlagByName("req"), lib.GetFlagByName("dry"), + lib.GetFlagByName("force"), lib.GetFlagByName("input"), lib.GetFlagByName("output"), lib.GetFlagByName("fast"), @@ -182,6 +183,8 @@ func main() { flag.StringVar(&actionRequest, "req", "", "perform the specified request (in quotes)") var actionRequestDry bool flag.BoolVar(&actionRequestDry, "dry", false, "validate a -req but do not send it to the Notecard") + var actionForce bool + flag.BoolVar(&actionForce, "force", false, "send a -req without validating it against the JSON schema") var actionWhenConnected bool flag.BoolVar(&actionWhenConnected, "when-connected", false, "wait until connected") var actionWhenDisconnected bool @@ -779,7 +782,7 @@ func main() { } // Validate the request against the schema - if err == nil && validateJSON { + if err == nil && validateJSON && !actionForce { var reqMap map[string]interface{} err = note.JSONUnmarshal([]byte(actionRequest), &reqMap) if err == nil {