oleksandr-balyshyn / scala-json-schema-example

The example of the unexpected behavior of scala-jsonschema library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scala-json-schema-example

The example of the unexpected behavior of scala-jsonschema library

Circe Example

{
    "$id" : "/schemas/data",
    "properties" : {
        "fieldName1" : {
            "type" : "string"
        },
        "fieldName2" : {
            "type" : "string"
        },
        "itMustBeVeryLongFieldName1" : {
            "type" : "string"
        }
    },
    "additionalProperties" : false,
    "$schema" : "http://json-schema.org/draft-07/schema#",
    "type" : "object",
    "required" : [
        "fieldName1",
        "fieldName2",
        "itMustBeVeryLongFieldName1"
    ]
}
{
  "field_name1" : "some value 1",
  "field_name2" : "some value 2",
  "it_must_be_very_long_field_name1" : "some value 3"
}

PlayJson example

{
  "$id" : "/schemas/data",
  "properties" : {
    "fieldName1" : {
      "type" : "string"
    },
    "fieldName2" : {
      "type" : "string"
    },
    "itMustBeVeryLongFieldName1" : {
      "type" : "string"
    }
  },
  "additionalProperties" : false,
  "$schema" : "http://json-schema.org/draft-07/schema#",
  "type" : "object",
  "required" : [ "fieldName1", "fieldName2", "itMustBeVeryLongFieldName1" ]
}
{
  "field_name1" : "some value 1",
  "field_name2" : "some value 2",
  "it_must_be_very_long_field_name1" : "some value 3"
}

About

The example of the unexpected behavior of scala-jsonschema library


Languages

Language:Scala 100.0%