Comments (2)
I did some digging, turned out to be very simpel. When you define an enum it should always be an array. Therefore whatever you throw at it will never pass in this example. Try setting it to an array and it will work as expected.
http://spacetelescope.github.io/understanding-json-schema/reference/generic.html#enumerated-values
The enum keyword is used to restrict a value to a fixed set of values. It must be an array with at least one element, where each element is unique.
from chai-json-schema.
Hej, @JrSchild. I'm happy that you took over maintenance of this valuable project. Also thanks for your response. You are right, the error was on my part.
from chai-json-schema.
Related Issues (20)
- Update to use chai 2.x HOT 3
- chai3 released yet HOT 4
- chai-json-schema needs a new owner HOT 22
- Roadmap next major release (v2.0?) HOT 7
- Currently published version isn't compatible with the latest chai HOT 18
- date-time format validation HOT 3
- peerDependencies error HOT 1
- Usage on karma HOT 2
- Print multiple errors HOT 2
- Nested schema objects raise "schema missing" HOT 1
- Not compatible with chai 4? HOT 3
- An in-range update of mocha is breaking the build 🚨 HOT 3
- An in-range update of grunt is breaking the build 🚨 HOT 2
- An in-range update of grunt-mocha is breaking the build 🚨 HOT 2
- type property in schema conflicts with data type HOT 1
- An in-range update of grunt-cli is breaking the build 🚨 HOT 2
- An in-range update of grunt-cli is breaking the build 🚨 HOT 1
- Silently passes when val is a String HOT 1
- Newer drafts of JSON Schema HOT 5
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 chai-json-schema.