-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running spectral CLI on OAS with external schemas produces incorrect results #751
Comments
Hey I can’t find the specs you’re talking about, is it the default branch you linked to, develop, or somewhere else? It’s hard to tel what’s going on from just the one file. |
@philsturgeon Hi, I´ve updated repo and issue description, |
@philsturgeon Any updates on this? Could I be of an assistance? |
Sorry I'm out of brain space to look into this, but hopefully one of the team will be with you soon! |
Hey, my sincere apologies for dropping a ball on this one. |
@huksley "resolutions": {
"@stoplight/json": "^3.2.2"
} Make sure to reinstall dependencies once resolution is set. Last but not least, make sure to remove the actual duplicate property in |
Thanks @P0lip! I done the changes specified and Schema errors are gone!!! It is in this branch/PR maasglobal/maas-tsp-api#52 > maas-tsp-api@0.0.3 lint-spec /Users/user/src/maas-tsp-api
> node utils/adopt-schemas.js && cross-env NODE_OPTIONS=--max_old_space_size=4096 spectral lint specs/booking.yml
OpenAPI 3.x detected
/Users/user/src/maas-tsp-api/specs/booking.yml
319:11 error oas3-schema /paths//bookings/options/get/parameters/4 should have required property '$ref'
✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints) I took a look at parameters, they are all have defined type via schema/$ref If I remove the - name: mode
description: 'Transfer mode'
in: query
required: false
schema:
$ref: ../schemas/core/components/travel-mode.json it starts to complain with this: /Users/user/src/maas-tsp-api/specs/booking.yml
337:15 error oas3-schema /paths//bookings/options/get/responses/200 should have required property '$ref' which is again looks fine to me 🤔 responses:
'200':
x-summary: Array of options
description: |
Available transport options matching the given query parameters. If no transport options are available; an empty array is returned.
content:
application/json:
schema:
$ref: ../schemas/tsp/booking-options-list/response.json
examples:
Taxi:
summary: Taxi
externalValue: '../examples/taxi/booking-options-response.json' Kind of related to #403 🤷♂ |
@huksley |
Description
When running spectral on OpenAPI 3 specification with externally defined schemas, spectral gives errors for completely valid schemas and OpenAPI Specification.
PLEASE NOTE Running spectral on schemas folder alone gives no errors 🤷♂
To Reproduce
npm install
npm run build
npm run lint
**Example case schemas/core/components/bike-station.json breakdown **
For following schema (when referenced from OAS):
produces following error:
Expected behavior
These errors should not be reported.
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: