Skip to content

Commit

Permalink
PB-687: switch to a supported OpenAPI validator.
Browse files Browse the repository at this point in the history
We currently use IBM's OpenAPI validator 0.54.0 (released circa February 2022)
from an old unsupported Docker image. With this change we update to version
1.19.2 (released June 2024) based on a Docker image shipped by IBM itself.

There were many changes in the validator since. In particular, the ruleset has
stricter checks about naming conventions that are specific to IBM guidelines
and which we don't follow. Rather than updating our specs to comply with IBM
guidelines, we disable these specific checks.

We also remove the old .validaterc configuration file which the newer validator
is not able to parse anyway.
  • Loading branch information
adk-swisstopo committed Jul 10, 2024
1 parent 48dd44c commit 1254bb7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 110 deletions.
9 changes: 9 additions & 0 deletions spec/.spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: '@ibm-cloud/openapi-ruleset'
rules:
# We generally follow the naming conventions from the upstream spec
# which does not match the IBM API naming conventions. So we turn off
# these specific validation rules.
ibm-parameter-casing-convention: off
ibm-property-casing-convention: off
ibm-enum-casing-convention: off
ibm-path-segment-casing-convention: off
109 changes: 0 additions & 109 deletions spec/.validaterc

This file was deleted.

2 changes: 1 addition & 1 deletion spec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OPENAPI = $(STATIC_BASE_DIR)/openapi.yaml
OPENAPI_TRANSACTIONAL = $(STATIC_BASE_DIR)/openapitransactional.yaml

YQ ?= docker run --rm -v ${PWD}:/workdir 974517877189.dkr.ecr.eu-central-1.amazonaws.com/external/openapi/yq:4.44.1
OPENAPI_VALIDATOR ?= docker run --volume "$(PWD)":/data 974517877189.dkr.ecr.eu-central-1.amazonaws.com/external/openapi/openapi-validator:0.54.0
OPENAPI_VALIDATOR ?= docker run --volume "$(PWD)":/data 974517877189.dkr.ecr.eu-central-1.amazonaws.com/external/openapi/openapi-validator:1.19.2

all: help

Expand Down

0 comments on commit 1254bb7

Please sign in to comment.