Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cache control rule
rules:
cache-control-undocumented:
description: |-
Cache usage MUST be extensively detailed in the `description` property
to avoid data leaks or the usage of stale data.
This rule should ensure in some way that the api provider
documented extensively the cache usage to avoid data leaks
or usage of stale data.
For now this just tests the presence of `max-age` but that's
only a placeholder. Hints welcome.
message: >-
Cache usage MUST be documented: {{error}}
formats:
- oas3
severity: error
given: >-
$..[parameters].[?(@.name=="cache-control" || @.name=="Cache-Control")]
then:
- field: description
function: pattern
functionOptions:
match: >-
max-age.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.