Skip to content

docs(validate): fix Spectral config examples to use YAML syntax#5273

Open
DeekRoumy wants to merge 2 commits intoasyncapi:masterfrom
DeekRoumy:fix/validate-spectral-yaml-examples
Open

docs(validate): fix Spectral config examples to use YAML syntax#5273
DeekRoumy wants to merge 2 commits intoasyncapi:masterfrom
DeekRoumy:fix/validate-spectral-yaml-examples

Conversation

@DeekRoumy
Copy link
Copy Markdown

@DeekRoumy DeekRoumy commented Mar 23, 2026

Summary

Fixes #5117

The .spectral.yaml file examples in the validate guide were written in JSON syntax, which is inconsistent with the .yaml file extension.

Changes

  • Converted both Spectral configuration code blocks in markdown/docs/guides/validate.md from JSON syntax to valid YAML syntax
  • Code block language tags changed from js to yaml
  • JSON structure (braces, quotes, commas) replaced with clean YAML formatting

Why this matters

New contributors following the guide may copy the JSON example and create an invalid .spectral.yaml file, causing Spectral to fail or behave unexpectedly.

Before / After

Before:

{
  "rules": {
    // add your own rules here
  }
}

After:

rules:
  # add your own rules here

Summary by CodeRabbit

  • Documentation
    • Updated the validation guide: Spectral configuration examples converted from JS/JSON-style snippets to YAML, with rewritten custom ruleset examples and clearer rule pattern illustrations for improved readability and consistency.

The .spectral.yaml file examples in the validate guide were written
in JSON syntax, which is inconsistent with the .yaml file extension
and can confuse contributors.

Converts both Spectral configuration examples to valid YAML format.

Fixes asyncapi#5117
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 23, 2026

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a540eff
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69c310fd2a7e5d0008eefdfb
😎 Deploy Preview https://deploy-preview-5273--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 48d68821-5362-4160-881e-cac76cb31903

📥 Commits

Reviewing files that changed from the base of the PR and between 76c54b0 and a540eff.

📒 Files selected for processing (1)
  • markdown/docs/guides/validate.md
✅ Files skipped from review due to trivial changes (1)
  • markdown/docs/guides/validate.md

📝 Walkthrough

Walkthrough

Updated the Spectral configuration example in the validation guide from JSON/JavaScript object syntax to valid YAML syntax to match the .spectral.yaml filename referenced in the documentation.

Changes

Cohort / File(s) Summary
Documentation Example Update
markdown/docs/guides/validate.md
Rewrote the Spectral config examples from JS/JSON object syntax into valid YAML: top-level rules: mapping, YAML comments, and then: expressed as a YAML list of rule objects (including functionOptions.match).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through docs so spry,
I swap the braces for a YAML sky.
Clean lines and lists now lead the way,
.spectral.yaml sings today. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(validate): fix Spectral config examples to use YAML syntax' accurately describes the main change: converting Spectral configuration examples from JSON to YAML format.
Linked Issues check ✅ Passed The PR addresses issue #5117 by converting Spectral configuration examples to valid YAML syntax as required, matching the .yaml file extension and preventing configuration errors.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the Spectral configuration examples in the validation guide; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (43ec12d) to head (76c54b0).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #5273   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          830       830           
  Branches       159       159           
=========================================
  Hits           830       830           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@asyncapi-bot
Copy link
Copy Markdown
Contributor

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 36
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-5273--asyncapi-website.netlify.app/

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@markdown/docs/guides/validate.md`:
- Around line 66-77: Indent the fenced YAML block so it is nested under the
numbered list item (step 3) — add the same leading indentation used by the list
item to the opening ```yaml fence, each line of the YAML (rules: ... match:
"^[A-Z]"), and the closing ``` fence so the entire block is rendered as part of
the list. Locate the triple-backtick YAML block containing "rules:
valid-document-version: ..." and adjust its indentation consistently to match
the surrounding list indentation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d51dccc0-736a-43d2-aece-693102dc0f37

📥 Commits

Reviewing files that changed from the base of the PR and between 43ec12d and 76c54b0.

📒 Files selected for processing (1)
  • markdown/docs/guides/validate.md

@SHUBHANSHU602
Copy link
Copy Markdown
Contributor

please do not open vague pr , issue has not been approved yet

CodeRabbit flagged that the YAML block was not properly nested under
list item 3, causing rendering issues. Added proper 3-space indentation
to align the fenced block with its parent list item.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

docs(validate): Spectral config example format does not match .yaml file

3 participants