stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.35k stars 226 forks source link

feat(rulesets): add new rule that requires sibling items field for type array #2632

Closed rainum closed 1 month ago

rainum commented 1 month ago

Fixes #2595.

This PR adds a new array-items rule for OAS 3.0.x which requires schemas with "type: array" to have a sibling "items" field.

There are some additional changes present that make tests more stable.

Checklist

Does this PR introduce a breaking change?

rainum commented 1 month ago

Looks good. @rainum Can we add a quick line here: https://github.com/stoplightio/spectral/blob/develop/docs/reference/openapi-rules.md

Oh, certainly! I completely forgot to do this, thanks for reminding me!

rainum commented 1 month ago

@mnaumanali94, I modified docs in 5bee34305381e9119da0a2d17ba7f69168a8ff0a 👌

mnaumanali94 commented 1 month ago

LGTM!

stoplight-bot commented 1 month ago

:tada: This PR is included in version 1.19.0 :tada:

The release is available on @stoplight/spectral-rulesets-1.19.0

Your semantic-release bot :package::rocket: