Comments (5)
Do you get a warning if you specify --verbose
?
from speccy.
Just checked and yes there's a warning if I specify --verbose
Without verbose:
$ node_modules/.bin/speccy lint openapi.yaml
Specification schema is invalid.
#/paths/~1example/get/responses/200/content/application~1json
expected '{\n "type": "object"\n "properties": {\n "example": {\n "type": "string"\n }\n }\n}\n' to be an object
expected '{\n "type": "object"\n "properties": {\n "example": {\n "type": "string"\n }\n }\n}\n' to have type object
expected 'string' to be 'object'
With verbose:
$ node_modules/.bin/speccy lint openapi.yaml --verbose
GET openapi.yaml
GET example-schema.json
{ YAMLException: missed comma between flow collection entries at line 3, column 3:
"properties": {
^
at generateError (node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
at throwError (node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
at readFlowCollection (node_modules/js-yaml/lib/js-yaml/loader.js:691:7)
at composeNode (node_modules/js-yaml/lib/js-yaml/loader.js:1333:11)
at readBlockMapping (node_modules/js-yaml/lib/js-yaml/loader.js:1009:16)
at composeNode (node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
at readDocument (node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
at loadDocuments (node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
at load (node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
at Object.safeLoad (node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
name: 'YAMLException',
reason: 'missed comma between flow collection entries',
mark:
Mark {
name: null,
buffer: '{\n "type": "object"\n "properties": {\n "example": {\n "type": "string"\n }\n }\n}\n\u0000',
position: 23,
line: 2,
column: 2 },
message: 'missed comma between flow collection entries at line 3, column 3:\n "properties": {\n ^' }
Creating initial clone of data at #/paths/~1example/get/responses/200/content/application~1json/schema
Finished resolution!
Found 14 rules: parameter-description,operation-operationId,operation-summary-or-description,operation-tags,server-trailing-slash,openapi-tags,openapi-tags-alphabetical,reference-no-other-properties,example-value-or-externalValue,reference-components-regex,no-script-tags-in-markdown,info-contact,license-apimatic-bug,no-eval-in-descriptions
Specification schema is invalid.
#/paths/~1example/get/responses/200/content/application~1json
expected '{\n "type": "object"\n "properties": {\n "example": {\n "type": "string"\n }\n }\n}\n' to be an object
expected '{\n "type": "object"\n "properties": {\n "example": {\n "type": "string"\n }\n }\n}\n' to have type object
expected 'string' to be 'object'
from speccy.
I'm gonna punt this one off to @MikeRalphson I think 😛
from speccy.
I'll make a note to look into whether the target of a $ref
can ever be other than json or yaml in the upcoming release of openapi-kit
, but for now I'll expose those warnings even when verbose
isn't set.
from speccy.
This has been solved through improving error messages in #37. Thank you @MikeRalphson!
from speccy.
Related Issues (20)
- False positive (lint and resolve) with referenced ($ref) examples HOT 1
- Rule path-keys-no-trailing-slash: throws lint error when path is a single slash HOT 2
- Passing "resolveInternal" option causes "RangeError" when resolving a spec HOT 6
- Hangs resolving external references with NodeJS >= 12.17.0 HOT 3
- Don't resolve internal reference HOT 1
- Multi $ref ? HOT 2
- Support for Async API HOT 1
- lint: Cannot read property 'failed' of undefined HOT 4
- resolve does not import tags HOT 1
- securitySchemes property "in" should be required HOT 1
- speccy serve redoc try HOT 1
- Access to every item on operation's parameters object HOT 1
- Implicit map keys need to be on a single line
- how to combine $ref and default? HOT 1
- The website is down (again)
- Adding SARIF result format support for speccy
- Is this project active? HOT 3
- Speccy lint whole project using gradle/maven build
- reused json schema is only converted once
- If an object just ref another object, the progress will be blocked
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speccy.