Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Fix for issue #104 #106

Merged
merged 2 commits into from
Feb 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ trait JSONSchemaReads {
case "number" => numberReader.map(asSchemaType)
case "array" => delegatingArrayReader.map(asSchemaType) orElse delegatingTupleReader.map(asSchemaType)
case "object" => delegatingObjectReader.map(asSchemaType)
case "null" => nullReader.map(s => s : SchemaType)
case "null" => nullReader.map(asSchemaType)
case other => Reads.apply(_ => JsError(s"Invalid JSON schema. Unknown $other type.")).map(asSchemaType)
}.or {
tupleReader.map(asSchemaType)
}.or {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.eclipsesource.schema.internal.serialization
package com.eclipsesource.schema

import com.eclipsesource.schema.{JsonSource, SchemaValidator}
import org.specs2.mutable.Specification
import play.api.libs.json.Json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.eclipsesource.schema.jsonforms
package com.eclipsesource.schema

import com.eclipsesource.schema._
import com.eclipsesource.schema.internal.validation.VA
import org.specs2.mutable.Specification
import play.api.libs.json._

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.eclipsesource.schema.internal.serialization

import com.eclipsesource.schema.JsonSource
import org.specs2.mutable.Specification

class SchemaReadsSpec extends Specification {

"Reads" should {

"not fail with match error (#104)" in {
val schema = JsonSource.schemaFromString("""
|{
| "someProp": {"type": "sting"}
|}""".stripMargin)

schema.isSuccess must beTrue
}
}

}