Skip to content

Instantly share code, notes, and snippets.

@mcroissant
Created April 26, 2021 14:51
Show Gist options
  • Save mcroissant/b47ff530d521f0f4ca502e6e7cbd2bf8 to your computer and use it in GitHub Desktop.
Save mcroissant/b47ff530d521f0f4ca502e6e7cbd2bf8 to your computer and use it in GitHub Desktop.
Spectral custom rule to check https
extends: spectral:oas
rules:
endpoint-should-be-https:
description: Endpoints should be using https
given: $.servers[*]
severity: error
then:
field: url
function: pattern
functionOptions:
match: "^https"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment