diff --git a/.check-schema/README.md b/.check-schema/README.md index d1c60e3a..0c70a1be 100644 --- a/.check-schema/README.md +++ b/.check-schema/README.md @@ -7,8 +7,8 @@ This project compares the JSON Schema from the Zilla to the [Reference](../src/r In the repository root directory run: ```bash -docker run -e ZILLA_INCUBATOR_ENABLED=true ghcr.io/aklivity/zilla:latest start -v -Pzilla.engine.verbose.schema.plain > ./.check-schema/zilla-schema.json -docker run -e ZILLA_INCUBATOR_ENABLED=true ghcr.io/aklivity/zilla:latest start -v -Pzilla.engine.verbose.schema > ./src/.vuepress/public/assets/zilla-schema.json +docker run -it --rm -e ZILLA_INCUBATOR_ENABLED=true ghcr.io/aklivity/zilla:latest start -v -Pzilla.engine.verbose.schema.plain > ./.check-schema/zilla-schema.json +docker run -it --rm -e ZILLA_INCUBATOR_ENABLED=true ghcr.io/aklivity/zilla:latest start -v -Pzilla.engine.verbose.schema > ./src/.vuepress/public/assets/zilla-schema.json ``` Once the docker container has printed "started" it must be deleted for the command to complete. diff --git a/.check-schema/index.js b/.check-schema/index.js index 8355fc01..9dc2752b 100644 --- a/.check-schema/index.js +++ b/.check-schema/index.js @@ -183,9 +183,9 @@ const main = async () => { ...(then.properties?.options?.properties || {}), } } : {}), - required: [...(props?.required || []), ...(then.required || [])], anyOf: [...(then.anyOf || [])], }, + required: [...(props?.required || []), ...(then.required || [])], })) ).flat(1); @@ -218,10 +218,10 @@ const main = async () => { } } } : {}), - required: [...(then.required || []), ...(required || [])], oneOf, anyOf: [...(then.anyOf || []), ...(anyOf || [])], }, + required: [...(then.required || []), ...(required || [])], }))); } else { sections.push({ @@ -240,8 +240,8 @@ const main = async () => { } } } : {}), - required: [...(then.required || [])], - } + }, + required: [...(then.required || [])], }); } }) @@ -255,9 +255,9 @@ const main = async () => { props: { ...(exporterProps?.properties || {}), ...(then.properties || {}), - required: [...(exporterProps?.required || []), ...(then.required || [])], anyOf: [...(then.anyOf || [])], - } + }, + required: [...(exporterProps?.required || []), ...(then.required || [])], })) ); sections.push( @@ -266,21 +266,21 @@ const main = async () => { name: fi.properties.model.const, props: { ...(then.properties || {}), - required: (then.required || []), anyOf: (then.anyOf || []), - } + }, + required: (then.required || []), })) ); // console.log("sections", JSON.stringify(sections)); - sections.forEach(({ folder, name, props }) => { + sections.forEach(({ folder, name, props, required }) => { delete props.type; delete props.kind; var foldername = `src/reference/config/${folder.replaceAll(".", "/")}`; var filename = `${name}.md`; var filePath = `${foldername}/${filename}`; // console.log(filePath, props); - var schemaAttrs = getObjProps(null, props, []); + var schemaAttrs = getObjProps(null, props, required); if (fs.existsSync(filePath)) { var fullMdContent = fs.readFileSync(filePath, "utf8") diff --git a/.check-schema/zilla-schema.json b/.check-schema/zilla-schema.json index 2254cf9c..a47f73d0 100644 --- a/.check-schema/zilla-schema.json +++ b/.check-schema/zilla-schema.json @@ -979,10 +979,10 @@ ] }, "key": { - "$ref": "#/$defs/converter/model" + "$ref": "#/$defs/converter" }, "value": { - "$ref": "#/$defs/converter/model" + "$ref": "#/$defs/converter" } } } @@ -1083,7 +1083,6 @@ "additionalProperties": false }, "tls": { - "type": "object", "properties": { "version": { "title": "Version", @@ -2231,7 +2230,7 @@ "type": "object", "patternProperties": { "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } } }, @@ -2242,7 +2241,7 @@ "type": "object", "patternProperties": { "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } } }, @@ -2250,7 +2249,7 @@ "type": "object", "patternProperties": { "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } } } @@ -2258,7 +2257,7 @@ "additionalProperties": false }, "content": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" }, "responses": { "type": "array", @@ -2288,12 +2287,12 @@ "type": "object", "patternProperties": { "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } } }, "content": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } }, "anyOf": [ @@ -2794,10 +2793,10 @@ "type": "string" }, "key": { - "$ref": "#/$defs/converter/model" + "$ref": "#/$defs/converter" }, "value": { - "$ref": "#/$defs/converter/model" + "$ref": "#/$defs/converter" } } } @@ -3005,12 +3004,10 @@ "title": "Entry", "type": "string", "pattern": "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$" - }, - "required": [ - "entry" - ] + } }, "required": [ + "entry", "routes" ] } @@ -3143,13 +3140,13 @@ "type": "string" }, "content": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" }, "user-properties": { "type": "object", "patternProperties": { "^[a-zA-Z]+[a-zA-Z0-9\\._\\-]*$": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } } } @@ -3840,7 +3837,7 @@ "type": "string" }, "content": { - "$ref": "#/$defs/validator/model" + "$ref": "#/$defs/validator" } }, "anyOf": [ @@ -4386,6 +4383,14 @@ ] }, "converter": { + "oneOf": [ + { + "$ref": "#/$defs/converter/types" + }, + { + "$ref": "#/$defs/converter/model" + } + ], "types": { "type": "string", "enum": [ @@ -4618,7 +4623,7 @@ "pattern": "((?:\\(|\\[))(-?\\d+)?,(-?\\d+)?((?:\\)|\\]))" }, "multiple": { - "type": "number" + "type": "integer" } }, "additionalProperties": false @@ -4841,16 +4846,22 @@ } }, "validator": { + "oneOf": [ + { + "$ref": "#/$defs/validator/types" + }, + { + "$ref": "#/$defs/validator/model" + } + ], "types": { "type": "string", "enum": [ - "avro", "double", "float", "int32", "int64", "json", - "protobuf", "string" ] }, diff --git a/src/reference/config/bindings/.partials/options-kafka-topics.md b/src/reference/config/bindings/.partials/options-kafka-topics.md index d7cf9cda..a9c83bd0 100644 --- a/src/reference/config/bindings/.partials/options-kafka-topics.md +++ b/src/reference/config/bindings/.partials/options-kafka-topics.md @@ -6,7 +6,7 @@ Topic name. #### topics[].key -> `object` +> `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ], `object` Enforce validation for key @@ -18,7 +18,7 @@ A schema or type to validate the topic's key. Refer to the individual [model](.. #### topics[].value -> `object` +> `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ], `object` Enforce validation for value @@ -27,7 +27,3 @@ Enforce validation for value > `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ] A schema or type to validate the topic's value. Refer to the individual [model](../../models) docs for type specific implementation. - -#### topics[].transforms - -> `array` diff --git a/src/reference/config/bindings/asyncapi/client.md b/src/reference/config/bindings/asyncapi/client.md index 8db7bd7b..fe5bb050 100644 --- a/src/reference/config/bindings/asyncapi/client.md +++ b/src/reference/config/bindings/asyncapi/client.md @@ -53,6 +53,10 @@ Topic configuration. Fetch offset to use for new consumers +#### topics[].transforms + +> `array` + #### kafka.sasl > `object` diff --git a/src/reference/config/bindings/asyncapi/proxy.md b/src/reference/config/bindings/asyncapi/proxy.md index d979d6a6..10c777e3 100644 --- a/src/reference/config/bindings/asyncapi/proxy.md +++ b/src/reference/config/bindings/asyncapi/proxy.md @@ -53,6 +53,10 @@ Topic configuration. Fetch offset to use for new consumers +#### topics[].transforms + +> `array` + #### kafka.sasl > `object` diff --git a/src/reference/config/bindings/asyncapi/server.md b/src/reference/config/bindings/asyncapi/server.md index 593fc0ed..777c49c6 100644 --- a/src/reference/config/bindings/asyncapi/server.md +++ b/src/reference/config/bindings/asyncapi/server.md @@ -53,6 +53,10 @@ Topic configuration. Fetch offset to use for new consumers +#### topics[].transforms + +> `array` + #### kafka.sasl > `object` diff --git a/src/reference/config/bindings/grpc-kafka/.partials/routes.md b/src/reference/config/bindings/grpc-kafka/.partials/routes.md index 219debee..03924f9a 100644 --- a/src/reference/config/bindings/grpc-kafka/.partials/routes.md +++ b/src/reference/config/bindings/grpc-kafka/.partials/routes.md @@ -1,5 +1,4 @@ - -### routes +### routes\* > `array` of `object` @@ -192,11 +191,13 @@ with: reply-to: responses ``` + #### with.topic\* > `string` The name of a Kafka topic for requests. + #### with.acks diff --git a/src/reference/config/bindings/http-kafka/.partials/routes.md b/src/reference/config/bindings/http-kafka/.partials/routes.md index 52d70c10..8b64e764 100644 --- a/src/reference/config/bindings/http-kafka/.partials/routes.md +++ b/src/reference/config/bindings/http-kafka/.partials/routes.md @@ -1,5 +1,4 @@ - -### routes +### routes\* > `array` of `object` @@ -244,11 +243,13 @@ with: location: /items/${params.id};cid=${correlationId} ``` + #### with.topic\* > `string` Kafka topic name, optionally referencing path parameter such as `${params.topic}`. + #### with.acks diff --git a/src/reference/config/bindings/http/.partials/options.md b/src/reference/config/bindings/http/.partials/options.md index 6f6bb9b1..e610f5f6 100644 --- a/src/reference/config/bindings/http/.partials/options.md +++ b/src/reference/config/bindings/http/.partials/options.md @@ -5,7 +5,7 @@ #### requests[].content -> `object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for the request content. @@ -21,7 +21,7 @@ A schema or type to validate the request content. Refer to the individual [model #### requests[].headers -> `object` as map of named:`object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` #### requests[].method @@ -33,7 +33,7 @@ A schema or type to validate the request content. Refer to the individual [model #### params.path -> `object` as map of named:`object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for path @@ -45,7 +45,7 @@ A schema or type to validate the path content. Refer to the individual [model](. #### params.query -> `object` as map of named:`object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for query @@ -65,15 +65,17 @@ A schema or type to validate the query content. Refer to the individual [model]( #### responses[].content -> `object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for the response content. + #### content.model\* > `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ] A schema or type to validate the response content. Refer to the individual [model](../../models) docs for type specific implementation. + #### responses[].content-type @@ -81,7 +83,7 @@ A schema or type to validate the response content. Refer to the individual [mode #### responses[].headers -> `object` as map of named:`object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for response headers. diff --git a/src/reference/config/bindings/kafka-grpc/.partials/routes.md b/src/reference/config/bindings/kafka-grpc/.partials/routes.md index b0a540cf..f8a2808d 100644 --- a/src/reference/config/bindings/kafka-grpc/.partials/routes.md +++ b/src/reference/config/bindings/kafka-grpc/.partials/routes.md @@ -1,4 +1,4 @@ -### routes +### routes\* > `array` of `object` diff --git a/src/reference/config/bindings/kafka/cache_server.md b/src/reference/config/bindings/kafka/cache_server.md index 1cef9d71..3775fd26 100644 --- a/src/reference/config/bindings/kafka/cache_server.md +++ b/src/reference/config/bindings/kafka/cache_server.md @@ -48,6 +48,10 @@ Topic configuration. Fetch offset to use for new consumers +#### topics[].transforms + +> `array` + diff --git a/src/reference/config/bindings/mqtt-kafka/.partials/options.md b/src/reference/config/bindings/mqtt-kafka/.partials/options.md index 98de2122..3dd9902a 100644 --- a/src/reference/config/bindings/mqtt-kafka/.partials/options.md +++ b/src/reference/config/bindings/mqtt-kafka/.partials/options.md @@ -1,4 +1,4 @@ -### options +### options\* > `object` diff --git a/src/reference/config/bindings/mqtt/server.md b/src/reference/config/bindings/mqtt/server.md index 7aae37c8..c75842c1 100644 --- a/src/reference/config/bindings/mqtt/server.md +++ b/src/reference/config/bindings/mqtt/server.md @@ -68,19 +68,19 @@ Topic name. #### topics[].content -> `object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for content #### content.model\* -> `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ] +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ] A schema or type to validate the request content. Refer to the individual [model](../../models) docs for type specific implementation. #### topics[].user-properties -> `object` as map of named:`object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for user provided properties. @@ -93,7 +93,7 @@ user-properties: #### user-properties.model\* -> `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ] +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ] A schema or type to validate the user-properties content. Refer to the individual [model](../../models) docs for type specific implementation. diff --git a/src/reference/config/bindings/openapi-asyncapi/.partials/options.md b/src/reference/config/bindings/openapi-asyncapi/.partials/options.md index 55762e26..45063d7c 100644 --- a/src/reference/config/bindings/openapi-asyncapi/.partials/options.md +++ b/src/reference/config/bindings/openapi-asyncapi/.partials/options.md @@ -1,4 +1,3 @@ - ### options > `object` @@ -60,6 +59,7 @@ Catalog artifact version to use. `catalog` catalog specific options. + #### catalog.subject\* > `string` @@ -71,3 +71,4 @@ Subject name used when storing the catalog artifact. > `string` | Default: `latest` Catalog artifact version to use. + diff --git a/src/reference/config/bindings/sse/.partials/options.md b/src/reference/config/bindings/sse/.partials/options.md index fdaec620..de0a3114 100644 --- a/src/reference/config/bindings/sse/.partials/options.md +++ b/src/reference/config/bindings/sse/.partials/options.md @@ -29,12 +29,12 @@ The path selector. #### requests[].content -> `object` +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ], `object` Enforce validation for the request content. #### content.model\* -> `enum` [ `avro`, `double`, `float`, `int32`, `int64`, `json`, `protobuf`, `string` ] +> `enum` [ `double`, `float`, `int32`, `int64`, `json`, `string` ] A schema or type to validate the request content. Refer to the individual [model](../../models) docs for type specific implementation. diff --git a/src/reference/config/guards/jwt.md b/src/reference/config/guards/jwt.md index 1028b389..63b9a9a7 100644 --- a/src/reference/config/guards/jwt.md +++ b/src/reference/config/guards/jwt.md @@ -52,7 +52,7 @@ guards: ## Configuration (\* required) -### options +### options\* > `object` diff --git a/src/reference/config/models/.partials/cataloged.md b/src/reference/config/models/.partials/cataloged.md index 0590abf6..841b3bdf 100644 --- a/src/reference/config/models/.partials/cataloged.md +++ b/src/reference/config/models/.partials/cataloged.md @@ -1,4 +1,4 @@ -### catalog +### catalog\* > `object` as map of named:`array` diff --git a/src/reference/config/models/protobuf.md b/src/reference/config/models/protobuf.md index 911ee805..7f969cec 100644 --- a/src/reference/config/models/protobuf.md +++ b/src/reference/config/models/protobuf.md @@ -38,7 +38,7 @@ Specifies the model is a `protobuf`. Transforms the model from this data type to the Protobuf schema on produce and to this data type from the Protobuf schema on consume. -### catalog +### catalog\* > `object` as map of named:`array` diff --git a/src/reference/config/telemetry/exporters/otlp.md b/src/reference/config/telemetry/exporters/otlp.md index 5485e036..3fd5f43b 100644 --- a/src/reference/config/telemetry/exporters/otlp.md +++ b/src/reference/config/telemetry/exporters/otlp.md @@ -27,7 +27,7 @@ exporters: ## Configuration (\* required) -### options +### options\* > `object` diff --git a/src/reference/config/zilla-cli.md b/src/reference/config/zilla-cli.md index aea115ab..c1f41745 100644 --- a/src/reference/config/zilla-cli.md +++ b/src/reference/config/zilla-cli.md @@ -3,7 +3,6 @@ category: - CLI description: The command line interface to control the Zilla runtime. --- - # Zilla Runtime CLI @@ -217,6 +216,7 @@ Set individual Zilla properties. zilla start -P zilla.engine.prop=value -P zilla.other.thing=value ``` + #### -v --verbose > `flag` @@ -226,6 +226,7 @@ Log verbose output to `stdout`. ```bash:no-line-numbers zilla start -v ``` + #### -w --workers