We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I noticed that definitions in the JSON schema must be capitalized for Argus to work. For this example adapted from the Argus readme:
package test import argus.macros._ import io.circe._ import io.circe.syntax._ @fromSchemaJson(""" { "title": "Example Schema", "type": "object", "definitions" : { "address": { "type": "object", "properties": { "number" : { "type": "integer" }, "street" : { "type": "string" } } }, "ErdosNumber": { "type": "integer" } }, "properties": { "name": { "type": "array", "items": { "type": "string" } }, "age": { "description": "Age in years", "type": "integer" }, "address" : { "$ref" : "#/definitions/address" }, "erdosNumber" : { "$ref" : "#/definitions/ErdosNumber" } } } """, name = "Person") object Schema object TestArgus { import Schema._ import Schema.Implicits._ val json = """ |{ | "name" : ["Bob", "Smith"], | "age" : 26, | "address" : { | "number" : 31, | "street" : "Main St" | }, | "erdosNumber": 123 |} """.stripMargin // Decode into generated case class val person = parser.decode[Person](json).right.toOption.get // Update address val personAddress = address(number = Some(42), street = Some("Alt St")) val newPerson = person.copy(address = Some(personAddress)) // Encode base to json newPerson.asJson }
I get a compile error:
[error] .../src/main/scala/test/TestArgus.scala:7: not found: type address [error] @fromSchemaJson(""" [error] ^
If I change the schema to use "Address" (and also the case class name to match), everything works. Is this intended?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I noticed that definitions in the JSON schema must be capitalized for Argus to work. For this example adapted from the Argus readme:
I get a compile error:
If I change the schema to use "Address" (and also the case class name to match), everything works. Is this intended?
The text was updated successfully, but these errors were encountered: