mirror of https://github.com/databricks/cli.git
updated embedded struct schema test
This commit is contained in:
parent
8a8f93e150
commit
410ba97ebc
|
@ -508,16 +508,17 @@ func TestSliceOfStructSchema(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestEmbeddedStructSchema(t *testing.T) {
|
||||
type Person struct {
|
||||
Name string `json:"name"`
|
||||
Age int `json:"age,omitempty"`
|
||||
}
|
||||
|
||||
type Location struct {
|
||||
Country string `json:"country"`
|
||||
State string `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type Person struct {
|
||||
Name string `json:"name"`
|
||||
Age int `json:"age,omitempty"`
|
||||
Home Location `json:"home"`
|
||||
}
|
||||
|
||||
type Plot struct {
|
||||
Events map[string]Person `json:"events"`
|
||||
}
|
||||
|
@ -546,6 +547,18 @@ func TestEmbeddedStructSchema(t *testing.T) {
|
|||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"home": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -560,18 +573,33 @@ func TestEmbeddedStructSchema(t *testing.T) {
|
|||
"age": {
|
||||
"type": "number"
|
||||
},
|
||||
"home": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}`
|
||||
|
||||
t.Log("[DEBUG] actual: ", string(jsonSchema))
|
||||
|
|
Loading…
Reference in New Issue