UNPKG

@apisyouwonthate/style-guide

Version:

Make your HTTP APIs better, faster, stronger, whether they are still being designed (API Design-First) or your organization has flopped various mismatched APIs into production and now you're thinking some consistency would be nice. Using Spectral and Open

31 lines (28 loc) 585 B
import { DiagnosticSeverity } from "@stoplight/types"; import testRule from "./__helpers__/helper"; testRule("api-home", [ { name: "valid case", document: { openapi: "3.1.0", info: { version: "1.0" }, paths: { "/": {} }, }, errors: [], }, { name: "invalid case", document: { openapi: "3.1.0", info: { version: "1.0" }, paths: {}, }, errors: [ { message: "APIs MUST have a root path (`/`) defined.", path: ["paths"], severity: DiagnosticSeverity.Warning, }, ], }, ]);