From e7a6b3d3d5286ce8c985bb0c89bcc1bb8882f2a2 Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Thu, 24 Oct 2024 22:47:33 +0200 Subject: [PATCH] Adjustments to schema --- config.go | 2 +- schema.json | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index 055d074..01c3bf4 100644 --- a/config.go +++ b/config.go @@ -59,7 +59,7 @@ func (c *Config) InitDefaults() error { //nolint:gocyclo,gocognit c.GrpcPool.InitDefaults() - if !strings.Contains(c.Listen, ":") { + if !strings.Contains(c.Listen, "://") { return errors.E(op, errors.Errorf("malformed grpc address, provided: %s", c.Listen)) } diff --git a/schema.json b/schema.json index 6521f26..296fbb1 100644 --- a/schema.json +++ b/schema.json @@ -6,17 +6,23 @@ "title": "roadrunner-grpc", "additionalProperties": false, "required": [ - "proto" + "proto", + "listen" ], "properties": { "listen": { - "description": "GRPC address to listen on.", - "$ref": "https://raw.githubusercontent.com/roadrunner-server/roadrunner/refs/heads/master/schemas/config/3.0.schema.json#/definitions/HostAndPortWithTCP" + "description": "gRPC address to listen on. Must begin with either `tcp://` or `unix://`.", + "type": "string", + "examples": [ + "tcp://127.0.0.1:443", + "${TCP:-tcp://127.0.0.1:443}", + "tcp://127.0.0.1:${TCP_PORT}" + ] }, "proto": { "type": "array", "minItems": 1, - "description": "Proto file to use. Multiple files are supported. Wildcards are allowed in the proto field.", + "description": "Proto file(s) to use. Multiple files are supported. Wildcards are allowed in the proto field.", "items": { "type": "string", "minLength": 1, @@ -73,7 +79,7 @@ "$ref": "#/$defs/duration" }, "max_concurrent_streams": { - "description": "The maximum number of concurrent streams. Empty or 0 means 10.", + "description": "The maximum number of concurrent streams. Empty or 0 defaults to 10.", "type": "integer", "default": 10 },