Replies: 2 comments
-
I have this same problem... I spent some time setting up spectral only to learn that by default it won't do anything. I was kind of expecting some basic rules like "description must be set in specific cases", "object properties must be camelCased" or some complex checks to rule out impossible situations like |
Beta Was this translation helpful? Give feedback.
-
I just built this custom function, it's a bit of a poor man's implementation of JSON schema validation, but it does just what i need it to do: https://github.com/erwinkramer/bank-api/blob/main/.spectral/functions/well-formed-object.js |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Validating an OpenAPI specification file is as simple as putting
extends: "spectral:oas"
into a.yaml
file, and passing this in as a parameter when callingspectral lint
.I have a use case where I don't have an OpenAPI specification inside a file, but just a plain JSON schema which I'd check for consistency? Is that possible? Given the fact that the
spectral:oas
ruleset relies on JSON Schema, and thedraft-2020-12
JSON schema definition is even included in the source tree, this should be rather straight-forward, right? Is it exposed as functionality somewhere? I tried usingspectral:jsonschema
andspectral:json-schema
, but none of these worked.Beta Was this translation helpful? Give feedback.
All reactions