Skip to content

Commit

Permalink
fix jsonschema tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowpigy committed Sep 1, 2024
1 parent c37cf9a commit e61fbc6
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions jsonschema/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestDefinition_MarshalJSON(t *testing.T) {
{
name: "Test with empty Definition",
def: jsonschema.Definition{},
want: `{"properties":{}}`,
want: `{}`,
},
{
name: "Test with Definition properties set",
Expand All @@ -35,8 +35,7 @@ func TestDefinition_MarshalJSON(t *testing.T) {
"description":"A string type",
"properties":{
"name":{
"type":"string",
"properties":{}
"type":"string"
}
}
}`,
Expand Down Expand Up @@ -66,12 +65,10 @@ func TestDefinition_MarshalJSON(t *testing.T) {
"type":"object",
"properties":{
"name":{
"type":"string",
"properties":{}
"type":"string"
},
"age":{
"type":"integer",
"properties":{}
"type":"integer"
}
}
}
Expand Down Expand Up @@ -114,23 +111,19 @@ func TestDefinition_MarshalJSON(t *testing.T) {
"type":"object",
"properties":{
"name":{
"type":"string",
"properties":{}
"type":"string"
},
"age":{
"type":"integer",
"properties":{}
"type":"integer"
},
"address":{
"type":"object",
"properties":{
"city":{
"type":"string",
"properties":{}
"type":"string"
},
"country":{
"type":"string",
"properties":{}
"type":"string"
}
}
}
Expand All @@ -146,25 +139,11 @@ func TestDefinition_MarshalJSON(t *testing.T) {
Items: &jsonschema.Definition{
Type: jsonschema.String,
},
Properties: map[string]jsonschema.Definition{
"name": {
Type: jsonschema.String,
},
},
},
want: `{
"type":"array",
"items":{
"type":"string",
"properties":{
}
},
"properties":{
"name":{
"type":"string",
"properties":{}
}
"type":"string"
}
}`,
},
Expand Down

0 comments on commit e61fbc6

Please sign in to comment.