Migrating from Spectral to Redocly CLI
说明与用途
从 Spectral 迁移到 Redocly CLI 提升了规则准确性,减少了误报,并简化了维护。AI 助手有助于生成高质量规则。
问题
Spectral’s maintenance issues and false positives make it unreliable for linting OpenAPI specs.
结果
Teams migrated to Redocly CLI with improved rule accuracy, reduced false positives, and lower maintenance overhead. AI assistance increased correct rule generation from 22% to 98% for Opus models.
工作流
- 1. Evaluate current Spectral rules and customizations.
- 2. Review Redocly migration guide and decide rule type (built‑in, configurable, plugin).
- 3. Convert rules: use Redocly cookbook YAML for simple cases, or create configurable rules via declarative YAML.
- 4. For complex rules, write plugin rules in JavaScript.
- 5. Run Redocly CLI lint on entry point; verify no false positives.
- 6. Optionally use AI skill
redocly-lint-ruleswithinspect-node-typesto auto‑generate rules. - 7. Validate migrated rules against original rule set and adjust as needed.
证据
Spectral has been the default OpenAPI linter for years, and it did serve the community well.
Spectral’s recent state of its maintenance has raised security and reliability concerns to the extent that some are forking the project to continue development independently.
Redocly CLI walks a type tree defined by the specification, so a Schema is always a schema, and $ref’s are followed into other files.
The table lists the percentage of the rules that were migrated correctly.
- 记录日期: 2026-10-13T12:41:09.738Z