andyglow / scala-jsonschema

Scala JSON Schema
Other
122 stars 38 forks source link

support empty schema #295

Open gabrieljones opened 1 year ago

gabrieljones commented 1 year ago

In JSON Schema, an empty object is a completely valid schema that will accept any valid JSON. https://json-schema.org/understanding-json-schema/basics.html#id1

You can also use true in place of the empty object to represent a schema that matches anything, or false for a schema that matches nothing.

import com.typesafe.config.ConfigValue

  implicit val configValueSchema: json.schema.Predef[ConfigValue] =
    json.schema.Predef(json.Schema.`empty`[ConfigValue]

Or maybe call it anything?

Expected Output:

{ }