Skip to content

Commit

Permalink
chore(release): 1.5.0 [skip ci]
Browse files Browse the repository at this point in the history
# [1.5.0](v1.4.1...v1.5.0) (2023-06-21)

### Features

* Localhost Exceptions & Inaccurate Long Resource Paths ([#57](#57)) ([db195e7](db195e7)), closes [#31](#31)
  • Loading branch information
semantic-release-bot committed Jun 21, 2023
1 parent db195e7 commit 4eddeed
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions sps-api-standards.spectral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ rules:
functionOptions:
max: 100
sps-hosts-https-only:
message: "Servers MUST be https and no other protocol is allowed."
message: "Servers MUST be https and no other protocol is allowed unless using localhost."
formats: [oas3]
severity: error
given: $.servers..url
then:
function: pattern
functionOptions:
match: "/^https:/"
match: ^(https:|http://localhost)
sps-hosts-lowercase:
message: "Server URL SHOULD BE lowercase."
formats: [oas3]
Expand All @@ -234,7 +234,7 @@ rules:
then:
function: pattern
functionOptions:
match: api.spscommerce.com|api.sps-internal.com
match: api.spscommerce.com|api.sps-internal.com|localhost
sps-path-no-environment:
message: "API paths MUST NOT indicate environment names."
severity: error
Expand All @@ -244,14 +244,14 @@ rules:
functionOptions:
notMatch: /prod/|/preprod/|/dev/|/test/|/integration/|/stage/
sps-hosts-no-port:
message: "Port MUST NOT be specified or required to use the API."
message: "Port MUST NOT be specified or required to use the API, except for 'localhost' testing in a spec."
formats: [oas3]
severity: error
given: $.servers..url
then:
function: pattern
functionOptions:
notMatch: (https?://.*):(\d*)\/?(.*)
notMatch: (?!https?://localhost)(https?://.*):(\d*)\/?(.*)
sps-paths-expose-technology:
message: "A resource MUST NOT leak or expose format or technology-specific information at any point in the path."
severity: error
Expand Down Expand Up @@ -309,14 +309,22 @@ rules:
function: pattern
functionOptions:
notMatch: //
sps-paths-limit-path-parameters:
message: The URL path should not contain more than 3 dynamic path parameters.
severity: warn
given: $.paths.*~
then:
function: pattern
functionOptions:
notMatch: ^(.*{{1}.*){4,}
sps-paths-limit-sub-resources:
message: The hierarchy of nested resources SHOULD NOT exceed more than 3 resources
message: The hierarchy of nested resources SHOULD NOT contain more than 8 resource names in the path.
severity: warn
given: $.paths.*~
then:
function: pattern
functionOptions:
match: ^\/[^\/]*((\/{[^}]*})*\/[^\/]*(\/{[^}]*})*){0,3}\/?$
notMatch: ^(.*\/{1}.*){9,}
sps-paths-with-http-methods:
message: "A resource SHOULD NOT contain HTTP methods."
severity: error
Expand Down

0 comments on commit 4eddeed

Please sign in to comment.