Skip to content

Commit

Permalink
refactor: Added hint to applying governance task
Browse files Browse the repository at this point in the history
  • Loading branch information
SensibleWood committed May 21, 2024
1 parent e14e32c commit d72be01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chapter-5-examples/applying-governance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ https://raw.githubusercontent.com/OAI/OAI-Courses/main/src/openapi-fundamentals/

## Task

If you are tackling the task from Chapter 3 here are a few hints on building your rule:
If you are tackling the task from the chapter _Using an OpenAPI document_ here are a few hints on building your rule:

- You'll need to find everything in the OpenAPI description that looks like a Schema object.
- You should filter for anything where `additionalProperties: false` is already set.
- You'll need to find everything in the OpenAPI description that looks like a Schema Object with a `type` value of `object`.
- You should filter for anything where `additionalProperties: false` is already set. As a hint, your JSON Path at this point should look something like this (but feel free to amend as required).
- You should provide an appropriate error message to indicate the issue.

As a hint your JSON Path will need to look something like this: `$..[?(@property == 'additionalProperties' && @ != false)]`

Please visit the Spectral documentation [page](https://docs.stoplight.io/docs/spectral) for more detailed information on how Spectral works.

0 comments on commit d72be01

Please sign in to comment.