Giter VIP home page Giter VIP logo

Comments (5)

jimblackler avatar jimblackler commented on May 27, 2024

So you're passing the ByteArrayInputStream into a schema constructor?

from jsonschemafriend.

jimblackler avatar jimblackler commented on May 27, 2024

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.

ryandietrich avatar ryandietrich commented on May 27, 2024

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.

jimblackler avatar jimblackler commented on May 27, 2024

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.

jimblackler avatar jimblackler commented on May 27, 2024

Added the new methods, see https://github.com/jimblackler/jsonschemafriend#basic-example-using-json-strings

from jsonschemafriend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.