chaijs / chai-json-schema Goto Github PK
View Code? Open in Web Editor NEWChai plugin for JSON Schema v4
License: MIT License
Chai plugin for JSON Schema v4
License: MIT License
Branch | Build failing π¨ |
---|---|
Dependency | grunt-cli |
Current Version | 1.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
grunt-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 11 commits.
89ab5d7
Merge pull request #120 from gruntjs/tag-1.3.0
28e8220
Fix node versions and CI
ebd818b
Release v1.3.0
eaf78d6
Merge pull request #117 from gruntjs/liftoff
98ba9e6
Use ~ for deps and update v8flags to 3.0.2
8ae6299
Fix completions to use old Grunt style for now
0c5f397
Fix version and help with no gruntfile
ea01dc5
Include grunt-cli version with --version
7b8cb3f
Implement liftoff into grunt-cli
7f6298e
Merge pull request #104 from paladox/patch-3
ccb75a6
Update grunt to 1.0.1
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
At least the following things should happen before the next release. I think having a better integration with Enrise's team ensures code quality, process management and release cycles. For now this project is mostly maintenance and making sure everything is up to date with today's standards.
want to reuse some schema, could you plz show some example?
Either port back from grunt-tv4
or externalise in import.
window.jsonpointer is undefined
, because jsonpointer correctly work with requirejs
If an object is passed as a string, instead of as an object, the validation will unconditionally pass.
This is a problem when an HTTP payload is passed directly (as a string) to assert.jsonSchema()
Maybe should throw an exception, or parse as JSON before passing to chai.Assertion()?
const chai = require('chai');
const assert = chai.assert;
chai.use(require('chai-json-schema'));
const testSchema = {
required: ['walletAddress'],
properties: {
walletAddress: {
type: 'string'
}
}
};
assert.jsonSchema({}, testSchema); // Fails correctly as expected
assert.jsonSchema("{}", testSchema); // DOES NOT FAIL
See
Line 183 in 82939b7
Branch | Build failing π¨ |
---|---|
Dependency | grunt |
Current Version | 1.0.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
grunt is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 27 commits.
ccc3163
v1.0.2
e7795dc
Remove iojs from test matrix (#1622)
a6a133b
Remove deprecation warning for coffeescript (#1621) r=@vladikoff
06b377e
https links to webchat.freenode.net and gruntjs.com (#1610)
7c5242f
Use node executable for local grunt bin for Windows support
f6cbb63
Oh right, Windows isnt bash
a9a20da
Try and debug why appveyor is failing on npm
48bba6c
Move to the test script to avoid npm was unexpected at this time.
6b97ac0
Try to fix appveyor script
19003ba
For appveyor, check node version to decide whether to install npm@3
3fcf921
Install npm@3 if npm version is npm 1 or 2
77fc157
Use the local version of grunt to run tests
400601a
Updating devDependencies
6592ad1
Update travis/appveyor to node versions we support
b63aeec
Dont manually install npm, use the version each node version corresponds with
There are 27 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I check your package.json, the peerDependencies shows
"peerDependencies": {
"chai": ">= 1.6.1 < 4"
}
But when I run npm install chai-json-schema
, it gives error:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "chai-json-schema" "--save"
npm ERR! node v6.0.0
npm ERR! npm v2.15.1
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants chai@>= 1.6.1 < 3
have no idea~
So far chai-version is limited to < 2
would it be possible to update it to use 2.x
(2.0.0
has been release last month with a couple of fixes)
Branch | Build failing π¨ |
---|---|
Dependency | mocha |
Current Version | 3.5.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As mocha is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
xit
export for "require" interface (@solodynamo)--compilers
coverage (@ScottFreeCode)The new version differs by 14 commits.
4070a44
Release v3.5.1
466ba73
update CHANGELOG.md for v3.5.1 [ci skip]
1cc0fc0
import/require xit, fixes #2972
74fa66f
update nyc to latest; remove workaround in travis script
aa52933
update coveralls strategy; closes #2984
73a5338
Spelling (#2981)
9f403bf
Add utils.escape
tests and fix unicode escaping
800acbc
whitelist "developer-experience" tag for stalebot [ci skip]
5895671
Added issue, pull request templates. (#2869)
075bd51
Merge pull request #2918 from mochajs/no-shell-test
8710438
Work around Node 0.10 Windows flake when testing
13b8340
Ensure that compiler lookup works and not just that transpilation works (#2922)
26d337a
Add tests for double-star behavior
c0e6b68
Eliminate glob.sh
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Consider this:
const schema = {
anyOf: [
{
"enum": 'some value'
},
{
$ref: 'invalid external schema reference'
}
]
};
expect('invalid value').not.to.be.jsonSchema(schema);
expect('some value').not.to.be.jsonSchema(schema);
Expected behaviour:
Test fails with missing schema error.
What happens instead:
The test will pass no matter what value is checked against schema.
Apologies if this is a dupe related to the sub-error issue. The following succeeds (when it shouldn't) with chai-json-schema yet fails (as expected) with the node jsonschema
library:
const schema =
{
type:"object",
properties:
{
exampleDate:
{
type:"string",
format:"date-time"
}
}
};
const mock =
{
exampleDate: "erroneous date value"
};
mock.should.be.jsonSchema(schema);
From time to time I have problem with circular objects.
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at valueStrim .... node_modules/chai-json-schema/index.js:53:17 # <--- here
at ...
Maybe because at this line the value
is a current response object (not object's body)?
Interesting, that response validation pass if I use tv4 object directly, so I have no errors and no missing schemas.
I've completely crashed out of the node loop so this module desperately needs a new owner.
If anyone wants to adopt please leave a message and we can arrange ownership transfer of repos and package as per npm guidelines.
Branch | Build failing π¨ |
---|---|
Dependency |
[grunt-mocha](https://github.com/disqus/grunt-mocha)
|
Current Version | 1.0.4 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
grunt-mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I can't install this package from npm when using Chai v3. Is there any special reason? Is it incompatible? I can see the source code already permits Chai v4, but it's probably not published as a package to npm yet.
They are marked out of date as of this writing, on the readme.
Hi @JrSchild - thanks for maintaining this chai plugin. It's very useful and should be a mandatory consideration for any project doing stuff with json and chai.
I've recently upped chai to version 4, and when installing chai-json-schema npm warns The package [email protected] does not satisfy its siblings' peerDependencies requirements!
(see travis jobs 99.1 - 99.3 and the PR greenkeeper made to up chai).
On npm versions < 3 (those distributed with node 4 and 0.x) this breaks any build using chai-json-schema.
I've forked chai-json-schema, changed the chai
peerDependencies range to >= 1.6.1 < 5
, upped the chai
dependency to 4.0.2 and ran the test suite => works OK.
1.3.1
to 1.3.2
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
grunt-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Following Schema always fails to validate, because I have property named type in my schema.
{ "type": "array", "items": { "_id": { "type": "string" }, "name" : { "type": "string" }, "bankId" : { "type": "string" }, "type" : { "type": "string" }, } }
How to use chai-json-schema with karma?
Hi, I'm trying to validate a complex schema. Some of my defined objects reference other defined objects, so there are nested references. Where these nested references are used, I get an error saying the schemas are missing. If I use a JSON schema validator, it confirms that my schema is valid.
Is there a way to have nested references?
Here is a simplified example:
{
"properties": {
"questions": { "$ref": "#/definitions/questions" }
},
"definitions": {
"answers": {
...
"id": "answers"
},
"questions": {
"properties": {
"answers": {
"type": "array",
"items": { "$ref": "#/definitions/answers" }
},
...
},
"id": "questions"
}
}
}
All the top level definitions (like questions
) work fine. And if instead of a reference to answers
, I just say "type": "object"
, the error goes away.
In many cases will be great when assertion prints all found errors in json. For that option library need to use tv4.validateMultiple method.
Is there any workaround to do this?
temporary npm install chai3-json-schema
Hey there! JSON Schema draft 4 is pretty old now. The project is currently on draft 7, most tools around support at least draft 6.
Instead of using tv4 which is also only support draft 4, you could use another validator which is keeping up to date. For example, AJV has support for draft 4, 5, 6 and 7, so that should help, and it'll make updates easier in the future - especially as you have greenkeeper. It'll just let you know when a new version is out, with new drafts. π
I don't use Chai enough to be able to justify working on this sadly, otherwise I'd be happy to turn this into a PR. If you have any questions I'm all ears. :)
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.