2026-09-21 23:45:18 +00:00
|
|
|
"""OpenAPI 3.1 + Redocly recommended, matching internal-portal (DEV-289)."""
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_openapi_uses_redocly_recommended():
|
|
|
|
|
redocly = (ROOT / ".redocly.yaml").read_text()
|
|
|
|
|
package = (ROOT / "package.json").read_text()
|
|
|
|
|
spec = (ROOT / "openapi.yaml").read_text()
|
|
|
|
|
ci = (ROOT / ".github" / "workflows" / "ci.yml").read_text()
|
|
|
|
|
assert "extends:" in redocly
|
|
|
|
|
assert "- recommended" in redocly
|
2026-09-21 23:55:40 +00:00
|
|
|
assert "operation-2xx-response: off" in redocly
|
|
|
|
|
assert "rule/operation-2xx-or-3xx-response" in redocly
|
2026-09-21 23:45:18 +00:00
|
|
|
assert "root: openapi.yaml" in redocly
|
|
|
|
|
assert '"openapi:lint"' in package
|
|
|
|
|
assert '"@redocly/cli": "2.52.1"' in package
|
|
|
|
|
assert "npm run openapi:lint" in ci
|
|
|
|
|
assert "openapi: 3.1.0" in spec
|
|
|
|
|
assert "required: [stage, sha]" in spec
|
|
|
|
|
assert "{ error: string }" in spec or "`{ error: string }`" in spec
|