mirror of https://github.com/databricks/cli.git
changed comment type
This commit is contained in:
parent
93e5c83091
commit
9599e63ffb
|
@ -37,29 +37,27 @@ 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
|
||||||
This function translates golang types into json schema. Here is the mapping
|
// between json schema types and golang types
|
||||||
between json schema types and golang types
|
//
|
||||||
|
// - GolangType -> Javascript type / Json Schema2
|
||||||
- GolangType -> Javascript type / Json Schema2
|
//
|
||||||
|
// - bool -> boolean
|
||||||
- bool -> boolean
|
//
|
||||||
|
// - string -> string
|
||||||
- string -> string
|
//
|
||||||
|
// - int (all variants) -> number
|
||||||
- int (all variants) -> number
|
//
|
||||||
|
// - float (all variants) -> number
|
||||||
- float (all variants) -> number
|
//
|
||||||
|
// - map[string]MyStruct -> { type: object, additionalProperties: {}}
|
||||||
- map[string]MyStruct -> { type: object, additionalProperties: {}}
|
// for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties
|
||||||
for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties
|
//
|
||||||
|
// - []MyStruct -> {type: array, items: {}}
|
||||||
- []MyStruct -> {type: array, items: {}}
|
// for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items
|
||||||
for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items
|
//
|
||||||
|
// - []MyStruct -> {type: object, properties: {}, additionalProperties: false}
|
||||||
- []MyStruct -> {type: object, 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) {
|
||||||
tracker := newTracker()
|
tracker := newTracker()
|
||||||
schema, err := safeToSchema(golangType, docs, "", tracker)
|
schema, err := safeToSchema(golangType, docs, "", tracker)
|
||||||
|
|
Loading…
Reference in New Issue