Comments (5)
So you're passing the ByteArrayInputStream into a schema constructor?
from jsonschemafriend.
Or is it the object to test that you're passing in that way? If that's the case and the object is a string of JSON, you'll have to parse it first using a parser library. For example using the org.json library it's
new JSONObject(jsonString).toMap()
from jsonschemafriend.
I was passing it in as a byteArrayInputStream. I was just confused how the library seemed to assume all schemas came from files and it didn't have a simple "string" based approach.
from jsonschemafriend.
I will add a new method to validate a string containing JSON data. Since there's a parser embedded already (for fetching schemas from http) it's not difficult to do. I can't change the behavior of the existing parse method as validating a string (not necessarily containing JSON data) by a schema is a valid thing to do.
from jsonschemafriend.
Added the new methods, see https://github.com/jimblackler/jsonschemafriend#basic-example-using-json-strings
from jsonschemafriend.
Related Issues (20)
- update to commons-collections4
- Issue in Android 5 HOT 1
- string date-time format HOT 1
- Support for custom error message in schema
- Parsing composite schema object definition HOT 5
- Support for JSON Schema simplification? HOT 3
- com.ibm.icu:icu4j is too heavy
- Failing to load draft-07 type schemas (probably lower ones too) HOT 1
- net.jimblackler.usejson.SyntaxError: JSON5: invalid end of input at 1:1 HOT 15
- Performance and functional comparison HOT 1
- Incorrect handling of format-assertions
- Set module name HOT 2
- type: integer does not match specification HOT 2
- The $ref is not resolved when referred schema is located in non-standard keywords HOT 1
- Schema with a wrong pointers to subschema passes the validation HOT 2
- SchemaStore enters infinite loop when $schema returns no content HOT 2
- Add support for custom formats
- 该库不支持安卓26以前的版本,请慎用。(This library does not support versions prior to Android 26, please use with caution.) HOT 1
- Support for custom types when document to be validated passed via a Map HOT 7
- Regular expression validation with CachedRegExPatternSupplier
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 jsonschemafriend.