You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isn't going to work because Json isn't found. It isn't imported and searching for a Json type within the repo doesn't help. Perhaps a compilable examples module or be more explicit in your readme?
The text was updated successfully, but these errors were encountered:
I see now that you need to depend on a json implementation such as circe or play in order to use this. And this is not stated in the readme. That is api does not come in if you simply depend on core.
import json._
val personSchema: json.Schema[Person] = Json.schema[Person]
works fine as is.
But may be broken iа you would import some other json or Json into the scope.
Please check if you have some Play stuff imported. Names may clash in that case.
depending in json-libraries is necessary in 2 cases
you are willing to convert Schema[X] into json ast of certain json-lib.. JsObject, JObject, etc
or your model have specified default values of types defined as enum, sealed trait, case class. Scala-JsonSchema library doesn't work with values. it's goal is to setup the contract between code and json-schema representation. so for values we use corresponding json-lib.
The documentation on the front page makes it difficult to pick up as a new user:
isn't going to work because
Json
isn't found. It isn't imported and searching for a Json type within the repo doesn't help. Perhaps a compilable examples module or be more explicit in your readme?The text was updated successfully, but these errors were encountered: