Giter VIP home page Giter VIP logo

circe-json-schema's Introduction

circe

Build status Coverage status Maven Central Discord

circe is a JSON library for Scala (and Scala.js).

Please see the guide for more information about why circe exists and how to use it.

Community

Adopters

Are you using circe? Please consider opening a pull request to list your organization here:

Other circe organization projects

Please get in touch on Gitter if you have a circe-related project that you'd like to discuss hosting under the circe organization on GitHub.

  • circe-benchmarks: Benchmarks for comparing the performance of circe and other JSON libraries for the JVM.
  • circe-config: A library for translating between HOCON, Java properties, and JSON documents.
  • circe-derivation: Experimental generic derivation with improved compile times.
  • circe-fs2: A library that provides streaming JSON parsing and decoding built on fs2 and Jawn.
  • circe-iteratee: A library that provides streaming JSON parsing and decoding built on iteratee.io and Jawn.
  • circe-jackson: A library that provides Jackson-supported parsing and printing for circe.
  • circe-spray: A library that provides JSON marshallers and unmarshallers for Spray using circe.
  • circe-yaml: A library that uses SnakeYAML to support parsing YAML 1.1 into circe's Json.

Related projects

The following open source projects are either built on circe or provide circe support:

  • Actor Messenger: A platform for instant messaging.
  • akka-http-json: A library that supports using circe for JSON marshalling and unmarshalling in Akka HTTP.
  • akka-stream-json: A library that provides JSON support for stream based applications using Jawn as a parser with a convenience example for circe.
  • Argus: Generates models and circe encoders and decoders from JSON schemas.
  • Blackdoor JOSE: circe JSON support for blackdoor JOSE and JWT.
  • borer: Allows circe encoders/decoders to be reused for CBOR (de)serialization.
  • circe-debezium: Circe codecs for Debezium payload types
  • circe-geojson: Circe support for GeoJSON (RFC 7946)
  • circe-kafka: Implicit conversion of Encoder and Decoder into Kafka Serializer/Deserializer/Serde
  • cornichon: A DSL for JSON API testing.
  • Cosmos: An API for DCOS services that uses circe.
  • crjdt: A conflict-free replicated JSON datatype in Scala.
  • diffson: A Scala diff / patch library for JSON.
  • elastic4s: A Scala client for Elasticsearch with circe support.
  • Enumeratum: Enumerations for Scala with circe integration.
  • Featherbed: A REST client library with circe support.
  • Finch: A library for building web services with circe support.
  • fintrospect: HTTP contracts for Finagle with circe support.
  • fluflu: A Fluentd logger.
  • Github4s: A GitHub API wrapper written in Scala.
  • content-api-models: The Guardian's Content API Thrift models.
  • http4s: A purely functional HTTP library for client and server applications.
  • IdeaLingua: Staged Interface Definition and Data Modeling Language & RPC system currently targeting Scala, Go, C# and TypeScript. Scala codegen generates models and JSON codecs using circe.
  • Iglu Schema Repository: A JSON Schema repository with circe support.
  • jsactor: An actor library for Scala.js with circe support.
  • jsoniter-scala-circe: A booster for faster parsing/printing to/from circe AST and decoding/encoding of java.time._ and BigInt types.
  • jwt-circe: A JSON Web Token implementation with circe support.
  • kadai-log: A logging library with circe support.
  • msgpack4z-circe: A MessagePack implementation with circe support.
  • ohNoMyCirce: Friendly compile error messages for shapeless's Generic, circe's Encoder & Decoder and slick's case class mapping.
  • play-circe: circe support for Play!.
  • pulsar4s: A Scala client for Apache-Pulsar with circe support.
  • Rapture: Support for using circe's parsing and AST in Rapture JSON.
  • roc: A PostgreSQL client built on Finagle.
  • sangria-circe: circe marshalling for Sangria, a GraphQL implementation.
  • scalist: A Todoist API client.
  • scala-jsonapi: Scala support library for integrating the JSON API spec with Spray, Play! or Circe
  • scala-json-rpc: JSON-RPC 2.0 library for Scala and Scala.js
  • scalatest-json-circe: Scalatest matchers for Json with appropriate equality and descriptive error messages.
  • Scio: A Scala API for Apache Beam and Google Cloud Dataflow, uses circe for JSON IO
  • seals: Tools for schema evolution and language-integrated schemata (derives circe encoders and decoders).
  • shaclex: RDF validation using SHACL or ShEx.
  • Slick-pg: Slick extensions for PostgreSQL.
  • sttp: Scala HTTP client.
  • Synapses: A lightweight Neural Network library, for js, jvm and .net.
  • telepooz: A Scala wrapper for the Telegram Bot API built on circe.
  • Zenith: Functional HTTP library built on circe.

Examples

The following projects provide examples, templates, or benchmarks that include circe:

Contributors and participation

circe is a fork of Argonaut, and if you find it at all useful, you should thank Mark Hibberd, Tony Morris, Kenji Yoshida, and the rest of the Argonaut contributors.

circe is currently maintained by Darren Gibson and Erlend Hamnaberg. After the 1.0 release, all pull requests will require two sign-offs by a maintainer to be merged.

The circe project is a typelevel affiliate project, and follow the Typelevel Code of Conduct

Please see the contributors' guide for details on how to submit a pull request.

License

circe is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

circe-json-schema's People

Contributors

jatcwang avatar scala-steward avatar sirmullich avatar travisbrown avatar zarthross avatar zmccoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

circe-json-schema's Issues

Rethink validation error representation

Currently this is a pretty slim wrapper for Everit's ValidationException, and there are probably some ways it could be improved. For a document with two schema violations, for example, there are three error values, since the top-level Everit exception ("2 schema violations found") is included.

Scala 3 support

Is there any plans to update circe-json-schema for scala 3?

I can see there has not been much activity as of late, is there still plans to maintain this project?

Newer json-schema versions support

The version supported in this library is currently draft 7 from json-schema but there are newer versions available.
Ideally, it would be great to support the latest 2020-12 json-schema version.

Some examples of schemas that are not present in this library as of now:

  • string with uuid format

Floating-point values are not handled correctly

It seems that the number type does not accept floating-point numbers 🤔

Code

import io.circe.Json
import io.circe.parser.parse
import io.circe.schema.Schema

val schema = Schema.loadFromString(
    """|{
       |  "type" : "object",
       |  "properties" : {
       |    "quantity" : {
       |      "type" : "number",
       |      "exclusiveMinimum" : 0
       |    }
       |  }
       |}
       |""".stripMargin
  ).get
  
val json1: Json = parse("""{ "quantity": 1 }""").right.get
val json2: Json = parse("""{ "quantity": 1.5 }""").right.get

println(schema.validate(json1))
println(schema.validate(json2))

Expected behavior

Valid(())
Valid(())

Actual behavior

Valid(())
Invalid(NonEmptyList(io.circe.schema.ValidationError$$anon$1: #/quantity: expected type: Number, found: String))

Unable to locate artifact despite adding jitpack resolver

Adding "io.circe" %% "circe-json-schema" % "0.1.0" to my dependencies does not work, although other circe packages like "io.circe" %% "circe-core" % "0.8.0" do work, which suggests that there's possibly some issue right now with the custom resolver.

I got around this issue by using the Maven version, "io.circe" % "circe-json-schema_2.13" % "0.1.0", but wanted to let you know the documented way of adding the package does not appear to be working for me.

Remove Everit dependency

The immediate goal for this library is to allow us to avoid referring to Everit validator types directly in our internal projects at Permutive, and the 0.1 release accomplishes this goal.

There are two next steps: to identify what other functionality is necessary for other potential adopters, and to remove the Everit dependency, which will allow us to avoid the non-Maven Central resolver as well as the runtime overhead of converting to the org.json JSON representation.

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.