-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added null schema, jsonString default converter and test for simple c…
…ases of native types
- Loading branch information
Showing
14 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
8 changes: 8 additions & 0 deletions
8
...-Core-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleArrayDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...ore-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleBooleanDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...ore-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleIntegerDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...a-Core-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleNullDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...Core-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleNumberDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...Core-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleObjectDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
8 changes: 8 additions & 0 deletions
8
...Core-Tests.package/JSONSchemaDefinitionTests.class/instance/testSimpleStringDefinition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
source/JSONSchema-Core-Tests.package/JSONSchemaDefinitionTests.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
3 changes: 3 additions & 0 deletions
3
source/JSONSchema-Core.package/JSONSchema.class/instance/jsonString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
conversion | ||
jsonString | ||
^ NeoJSONWriter toString: self |
Empty file.
3 changes: 3 additions & 0 deletions
3
source/JSONSchema-Core.package/JSONSchemaNull.class/class/typeName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
instance creation | ||
typeName | ||
^ 'null' |
11 changes: 11 additions & 0 deletions
11
source/JSONSchema-Core.package/JSONSchemaNull.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
4 changes: 2 additions & 2 deletions
4
source/JSONSchema-Core.package/JSONSchemaObject.class/instance/properties.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]" |