IBM / openapi-validator

Configurable and extensible validator/linter for OpenAPI documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running lint-openapi since v1.18.1

chadxz opened this issue · comments

I'm getting this error:

[ERROR] Problem reading Spectral ruleset file '/Users/chad/src/smartrr/.spectral.yml': Cannot extend non-existing rule: "array-items"

My config file looks like this:

# .spectral.yml
extends: "@ibm-cloud/openapi-ruleset"
rules:
  ibm-path-segment-casing-convention: off
  ibm-parameter-casing-convention: off
  ibm-property-casing-convention: off
  ibm-enum-casing-convention: off
  ibm-no-array-responses: off
  no-$ref-siblings: off

and i'm running the command lint-openapi -e backend/openapi/vendor.json

This all worked prior to the upgrade. I also tried upgrading to the latest and it still has the issue. I believe the issue was introduced in 1.18.1 by this. I was on 1.18.0 and things were working fine.

Some more info about my install:

❯ yarn info ibm-openapi-validator      
└─ ibm-openapi-validator@npm:1.18.1
   ├─ Version: 1.18.1
   │ 
   ├─ Exported Binaries
   │  └─ lint-openapi
   │ 
   └─ Dependencies
      ├─ @ibm-cloud/openapi-ruleset@npm:1.17.1 → npm:1.17.1
      ├─ @stoplight/spectral-cli@npm:^6.11.1 → npm:6.11.1
      ├─ @stoplight/spectral-core@npm:^1.18.3 → npm:1.18.3
      ├─ @stoplight/spectral-parsers@npm:^1.0.4 → npm:1.0.4
      ├─ ajv@npm:^8.12.0 → npm:8.12.0
      ├─ chalk@npm:^4.1.2 → npm:4.1.2
      ├─ commander@npm:^10.0.1 → npm:10.0.1
      ├─ find-up@npm:5.0.0 → npm:5.0.0
      ├─ globby@npm:^11.0.4 → npm:11.1.0
      ├─ js-yaml@npm:^3.14.1 → npm:3.14.1
      ├─ json-dup-key-validator@npm:^1.0.3 → npm:1.0.3
      ├─ lodash@npm:^4.17.21 → npm:4.17.21
      ├─ pad@npm:^2.3.0 → npm:2.3.0
      └─ semver@npm:^7.6.0 → npm:7.6.2

@chadxz I'm unable to reproduce. Perhaps some more info about your setup would be helpful. Do you have the ruleset package installed locally?

No, just the validator itself. Will see if I can repro in codesandbox.

I was able to address this by completely removing the package then adding it back. I guess it was something related to my yarn.lock file. Thanks for the sanity check and your help!

No problem - glad it's working!