IBM / openapi-validator

Configurable and extensible validator/linter for OpenAPI documents
Apache License 2.0
493 stars 88 forks source link

feat: add new 'ibm-no-ref-in-example' rule #669

Closed padamstx closed 4 months ago

padamstx commented 4 months ago

PR summary

This commit introduces the new 'ibm-no-ref-in-example' rule which will check to make sure that "$ref" is not used in "example" fields. Note that $ref is valid in an "examples" field, but not in an "example" field.

PR Checklist

General checklist

Please make sure that your PR fulfills the following requirements:

Checklist for adding a new validation rule:

padamstx commented 4 months ago

@dpopp07 @HenryGessau @meem I've updated the rule function so that it performs the search for a $ref field recursively, and I've updated the tests accordingly.

ibm-devx-sdk commented 4 months ago

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

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

ibm-devx-sdk commented 4 months ago

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

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

ibm-devx-sdk commented 3 weeks ago

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

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket: