jakubonderka / api-blueprint-validator Goto Github PK
View Code? Open in Web Editor NEWApiary API Blueprint Validator
License: MIT License
Apiary API Blueprint Validator
License: MIT License
On node v6.2.2 and api-blueprint-validator 0.1.3:
$ ./node_modules/.bin/api-blueprint-validator ./api.md
./node_modules/.store/[email protected]/_/src/validator.js:74
result.warnings.forEach(function (warning) {
^
TypeError: Cannot read property 'forEach' of undefined
at ./node_modules/.store/[email protected]/_/src/validator.js:74:22
In some cases the warning are actually fatal to the output of the api-blueprint parser (apiary for example).
Proposal to add a --fail-on-warning=false
flag to the tool so that users can decide whether they want to be more restrictive with their validation (I have this validation tool as a part of my automated CI build, and it returns 0 when there are warnings).
From looking at the source code it looks like this might need to be a feature added to protagonist.
The command line tool should return an exit status greater than zero if validation fails in any way.
Valid example blueprint is considered invalid
Error in JSON response in group "Coupons", resource "Coupons", action "Retrieve a Coupon"
Parse error on line 1:
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'EOF'
Error in JSON response in group "Coupons", resource "Coupons", action "List all Coupons"
Parse error on line 1:
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'EOF'
Error in JSON request in group "Coupons", resource "Coupons", action "Create a Coupon"
Parse error on line 1:
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'EOF'
Error in JSON response in group "Coupons", resource "Coupons", action "Create a Coupon"
Parse error on line 1:
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'EOF'
Currently you declare a hard-coded version dependency on protagonist
. Can you either update the dependency to the latest (v0.17.1) or switch to an appropriate semver range instead?
Fresh install from npm
$ node --version
v8.2.1
$ npm --version
5.3.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.