mirror of https://github.com/databricks/cli.git
fixed typo, and tested schema is working
This commit is contained in:
parent
926db54a6d
commit
cc5ed2bc76
|
@ -11,15 +11,15 @@ const MaxHistoryOccurances = 3
|
||||||
// TODO: should omit empty denote non required fields in the json schema?
|
// TODO: should omit empty denote non required fields in the json schema?
|
||||||
type Schema struct {
|
type Schema struct {
|
||||||
Type JsType `json:"type"`
|
Type JsType `json:"type"`
|
||||||
Properities map[string]*Property `json:"properities,omitempty"`
|
Properities map[string]*Property `json:"properties,omitempty"`
|
||||||
AdditionalProperities *Property `json:"additionalProperities,omitempty"`
|
AdditionalProperities *Property `json:"additionalProperties,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Property struct {
|
type Property struct {
|
||||||
Type JsType `json:"type"`
|
Type JsType `json:"type"`
|
||||||
Items *Item `json:"item,omitempty"`
|
Items *Item `json:"item,omitempty"`
|
||||||
Properities map[string]*Property `json:"properities,omitempty"`
|
Properities map[string]*Property `json:"properties,omitempty"`
|
||||||
AdditionalProperities *Property `json:"additionalProperities,omitempty"`
|
AdditionalProperities *Property `json:"additionalProperties,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: panic for now, add support for adding schemas to $defs in case of cycles
|
// TODO: panic for now, add support for adding schemas to $defs in case of cycles
|
||||||
|
|
|
@ -44,7 +44,7 @@ func TestNumberStringBooleanSchema(t *testing.T) {
|
||||||
expected :=
|
expected :=
|
||||||
`{
|
`{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properities": {
|
"properties": {
|
||||||
"bool_val": {
|
"bool_val": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
@ -119,10 +119,10 @@ func TestObjectSchema(t *testing.T) {
|
||||||
expected :=
|
expected :=
|
||||||
`{
|
`{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properities": {
|
"properties": {
|
||||||
"hero": {
|
"hero": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properities": {
|
"properties": {
|
||||||
"age": {
|
"age": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
@ -133,7 +133,7 @@ func TestObjectSchema(t *testing.T) {
|
||||||
},
|
},
|
||||||
"plot": {
|
"plot": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properities": {
|
"properties": {
|
||||||
"stakes": {
|
"stakes": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"item": {
|
"item": {
|
||||||
|
@ -144,7 +144,7 @@ func TestObjectSchema(t *testing.T) {
|
||||||
},
|
},
|
||||||
"villian": {
|
"villian": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properities": {
|
"properties": {
|
||||||
"age": {
|
"age": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue