From ba007569a85fde600a143b1e9986e079c78a0978 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 20 May 2026 23:32:29 +0800 Subject: [PATCH 1/2] docs(validate): convert Spectral config example to valid YAML --- markdown/docs/guides/validate.md | 39 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/markdown/docs/guides/validate.md b/markdown/docs/guides/validate.md index a17ccf35bf7f..b8403f390531 100644 --- a/markdown/docs/guides/validate.md +++ b/markdown/docs/guides/validate.md @@ -57,34 +57,23 @@ To get started: 1. Install [Spectral](https://meta.stoplight.io/docs/spectral/b8391e051b7d8-installation). 2. Create a file named `.spectral.yaml` to begin writing your API description and document rules. Example: - ```js - { - "rules": { - // add your own rules here - } - } + ```yaml + rules: + # add your own rules here ``` 3. Create and add your own custom ruleset: - ```js - { - "rules": { - "valid-document-version": { - "message": "Application title must start with upper case", - "severity": "error", - "given": "$.info", - "then": [ - { - "field": "title", - "function": "pattern", - "functionOptions": { - "match": "^[A-Z]" - } - } - ] - } - } - } + ```yaml + rules: + valid-document-version: + message: "Application title must start with upper case" + severity: "error" + given: "$.info" + then: + - field: "title" + function: "pattern" + functionOptions: + match: "^[A-Z]" ``` 4. After setting up Spectral and creating custom rules following steps 1 - 3, validate your AsyncAPI document using this Spectral CLI command: From eb02738b53f8f025413bb57d27a2e76f89d436ce Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 21 May 2026 02:48:55 +0800 Subject: [PATCH 2/2] fix: address CodeRabbit review - collapse img tag, indent YAML code block --- markdown/docs/guides/validate.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/markdown/docs/guides/validate.md b/markdown/docs/guides/validate.md index b8403f390531..6e67aa920450 100644 --- a/markdown/docs/guides/validate.md +++ b/markdown/docs/guides/validate.md @@ -63,18 +63,18 @@ To get started: ``` 3. Create and add your own custom ruleset: - ```yaml - rules: - valid-document-version: - message: "Application title must start with upper case" - severity: "error" - given: "$.info" - then: - - field: "title" - function: "pattern" - functionOptions: - match: "^[A-Z]" - ``` + ```yaml + rules: + valid-document-version: + message: "Application title must start with upper case" + severity: "error" + given: "$.info" + then: + - field: "title" + function: "pattern" + functionOptions: + match: "^[A-Z]" + ``` 4. After setting up Spectral and creating custom rules following steps 1 - 3, validate your AsyncAPI document using this Spectral CLI command: