Skip to content

Commit

Permalink
chore(release): 1.3.0 [skip ci]
Browse files Browse the repository at this point in the history
# [1.3.0](v1.2.0...v1.3.0) (2023-01-16)

### Features

* URN-like Domain Reference Standards ([#46](#46)) ([f3e2953](f3e2953))
  • Loading branch information
semantic-release-bot committed Jan 16, 2023
1 parent ec58b47 commit a75c315
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions sps-api-standards.spectral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,65 @@ rules:
values:
- application/problem+xml
- application/problem+json
# domain references (URN-like values)
sps-ref-property-name:
description: Property with the name 'ref' MUST be of type 'sps-ref' following URN-like reference formats.
severity: error
formats: [oas3]
given: '$..[?((@property=== "ref" || @property === "Ref") && @.$ref == null && @.allOf == null && @.oneOf == null)]'
then:
- field: "format"
function: truthy
- field: "format"
function: pattern
functionOptions:
match: 'sps-ref'
sps-ref-schema:
description: Properties following 'sps-ref' format MUST use the standardized schema - maxLength (255), minLength(7), pattern (includes 'sps'), type (string).
message: '{{property}} is not provided or not following required schema values.'
severity: error
formats: [oas3]
given: '$..[?(@property=== "format" && @ == "sps-ref")]^'
then:
- function: schema
functionOptions:
schema:
type: object
required:
- maxLength
- minLength
- type
- pattern
properties:
maxLength:
type: integer
minimum: 255
maximum: 255
minLength:
type: integer
minimum: 7
maximum: 7
type:
type: string
pattern:
type: string
- field: pattern
function: pattern
functionOptions:
match: 'sps'
- field: type
function: pattern
functionOptions:
match: '^string$'
sps-ref-in-url:
description: Parameters for sps-ref formatted URN-like references SHOULD NOT be used in query or path parameters.
severity: warn
formats: [oas3]
given: '$..[?((@.name == "ref" || @.name == "Ref") && (@.in=="query" || @.in=="path"))]'
then:
field: name
function: falsy
# fingerprint property usage and naming
sps-fingerprint-naming:
description: Rather than property names refering to the implementation for 'hash' or 'hashkey', you MUST use the property name 'fingerprint'.
message: '{{property}} is not using property name fingerprint.'
Expand Down

0 comments on commit a75c315

Please sign in to comment.