mirror of https://github.com/databricks/cli.git
another attempt at solving fmt issues
This commit is contained in:
parent
2ca648718a
commit
2e0c3928f7
|
@ -37,29 +37,31 @@ type Schema struct {
|
||||||
Required []string `json:"required,omitempty"`
|
Required []string `json:"required,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function translates golang types into json schema. Here is the mapping
|
/*
|
||||||
// between json schema types and golang types
|
This function translates golang types into json schema. Here is the mapping
|
||||||
// - GolangType -> Javascript type / Json Schema2
|
between json schema types and golang types
|
||||||
// - bool -> boolean
|
- GolangType -> Javascript type / Json Schema2
|
||||||
// - string -> string
|
- bool -> boolean
|
||||||
// - int (all variants) -> number
|
- string -> string
|
||||||
// - float (all variants) -> number
|
- int (all variants) -> number
|
||||||
// - map[string]MyStruct -> {
|
- float (all variants) -> number
|
||||||
// type: object
|
- map[string]MyStruct -> {
|
||||||
// additionalProperties: {}
|
type: object
|
||||||
// }
|
additionalProperties: {}
|
||||||
// for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties
|
}
|
||||||
// - []MyStruct -> {
|
for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties
|
||||||
// type: array
|
- []MyStruct -> {
|
||||||
// items: {}
|
type: array
|
||||||
// }
|
items: {}
|
||||||
// for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items
|
}
|
||||||
// - []MyStruct -> {
|
for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items
|
||||||
// type: object
|
- []MyStruct -> {
|
||||||
// properties: {}
|
type: object
|
||||||
// additionalProperties: false
|
properties: {}
|
||||||
// }
|
additionalProperties: false
|
||||||
// for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#properties
|
}
|
||||||
|
for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#properties
|
||||||
|
*/
|
||||||
func NewSchema(golangType reflect.Type, docs *Docs) (*Schema, error) {
|
func NewSchema(golangType reflect.Type, docs *Docs) (*Schema, error) {
|
||||||
seenTypes := map[reflect.Type]struct{}{}
|
seenTypes := map[reflect.Type]struct{}{}
|
||||||
debugTrace := list.New()
|
debugTrace := list.New()
|
||||||
|
|
Loading…
Reference in New Issue