Comments (2)
Change main.json to say
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "1.1.0",
"title": "My Main Schema",
"description": "reprex schema",
"type": "object",
"properties": {
"the_object": {
"type": "object",
"properties": {
"my_nested_object": {
"$ref": "objects.json#/properties/objects"
}
}
}
}
}
and validate with
jsonvalidate::json_validate("test.json", "main.json", engine = "ajv")
Several things are going on here that are not great:
- We need to move towards deprecating imjv, or warning if people use it. The schema validator is not as powerful and not all features that we've added recently are supported on it. We use ajv for everything, and you will need that for more recent json schema versions
- We should detect use of references with imjv and warn that they are being ignored.
- We should also allow
./path
to be treated aspath
; I've not seen that before
Pull requests on any of these welcome, otherwise I'll look at these issues next time we work on the package
from jsonvalidate.
Thank you for the tip @richfitz!
What are imjv
specific references and how do they differ from ajv
? I might be able to PR that.
Changing the paths and using ajv
seems to be validating as expected now.
from jsonvalidate.
Related Issues (20)
- Using draft-06 const with schema draft-04 not throwing error HOT 1
- can't validate against draft-04 meta schema HOT 4
- Regex flag when specifying a pattern HOT 1
- Dev version fails with biocompute HOT 1
- Refactor validator instances to have one per context
- Use roxygen markdown
- Deprecate and remove dataPath from errors
- Revdep failure with clinDataReview HOT 2
- Latest CRAN headaches
- Latest jsonvalidate throws "SyntaxError: Use of const in strict mode." HOT 17
- Is it possible to simply validate a JSON string? HOT 1
- Support for external references in json schema HOT 2
- Can't resolve path to sub-schemas in sub-folders HOT 4
- Resolve pointers (references) in json being validated prior to validation HOT 2
- More options for serialising `NULL` & `NA` when serialising?
- Support for protocol-based sub-schemas HOT 2
- Support options for `ajv` HOT 1
- Not sure how else to put this, it doesn't appear to work. HOT 1
- Serialization using `$ref` returns arrays
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 jsonvalidate.