Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 708 Bytes

File metadata and controls

35 lines (29 loc) · 708 Bytes

API rules

  1. base-path-must-start-with-slash

base-path-must-start-with-slash

❌ This test should not pass, as the server's url fails the rule

#👻-failures: 0 base-path-must-start-with-slash
openapi: 3.0.1
info:
  title: Test
  version: 1.0.0
servers:
- url: do-not-start-with-slash #in fact, it should fail here
Spectral rule 🤖
#👻-rule
base-path-must-start-with-slash:
  description: Base path must start with /.
  message: "{{description}}. But was {{value}}."
  given: $.servers[*]
  severity: error
  then:
    field: url
    function: pattern
    functionOptions:
      match: "^\/"