Skip to content

Commit

Permalink
Added null schema, jsonString default converter and test for simple c…
Browse files Browse the repository at this point in the history
…ases of native types
  • Loading branch information
noha committed Oct 9, 2018
1 parent 6b227d1 commit 7624e81
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 2 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleArrayDefinition
| definition schema string |
string := '{"type":"array"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaArray.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleBooleanDefinition
| definition schema string |
string := '{"type":"boolean"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaBoolean.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleIntegerDefinition
| definition schema string |
string := '{"type":"integer"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaInteger.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleNullDefinition
| definition schema string |
string := '{"type":"null"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaNull.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleNumberDefinition
| definition schema string |
string := '{"type":"number"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaNumber.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleObjectDefinition
| definition schema string |
string := '{"type":"object"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaObject.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSimpleStringDefinition
| definition schema string |
string := '{"type":"string"}'.
definition := JSONSchemaDefinition fromString: string.
schema := definition schema.
self assert: schema class equals: JSONSchemaString.
self assert: schema jsonString equals: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "TestCase",
"category" : "JSONSchema-Core-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JSONSchemaDefinitionTests",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
conversion
jsonString
^ NeoJSONWriter toString: self
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance creation
typeName
^ 'null'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JSONPrimitiveSchema",
"category" : "JSONSchema-Core-Model",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JSONSchemaNull",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
properties
^ properties ifNil: [
properties := Dictionary new ]
^ properties "ifNil: [
properties := Dictionary new ]"

0 comments on commit 7624e81

Please sign in to comment.