From a8817cab0b99fcbbfca85bd8adfc06d5066ae391 Mon Sep 17 00:00:00 2001 From: riccardom Date: Mon, 14 Sep 2026 09:20:52 +0200 Subject: [PATCH] [management] Put the debug upload URL's https-and-host rule in the OpenAPI schema The account handler rejects a non-empty value unless url.Parse yields scheme https and a host, but the schema said only "string", so a schema-driven consumer saw an unconstrained field and learned the contract from a 422. Add a pattern that allows "" for the fallback and otherwise requires https with a host. Regenerating types.gen.go produces no diff: our oapi-codegen config emits types only, so the pattern documents the contract rather than enforcing it in Go. The handler stays the thing that rejects. Reported by CodeRabbit and cubic on #7514. --- shared/management/http/api/openapi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/management/http/api/openapi.yml b/shared/management/http/api/openapi.yml index 3987e92fd..1df128cb1 100644 --- a/shared/management/http/api/openapi.yml +++ b/shared/management/http/api/openapi.yml @@ -390,6 +390,7 @@ components: URL with a host. Empty falls back to the deployment-wide value configured on the management server, and with neither to the upload service NetBird runs. type: string + pattern: '^$|^https://[^/?#:\s]+(:[0-9]+)?([/?#].*)?$' example: "https://upload.example.com/upload-url" agent_network_only: description: Limits the dashboard to the Agent Network surface for this account. Set for accounts created via netbird.ai signups and can be disabled later. Enabling this requires dashboard_features.agent_network to be true in the same request.