mirror of https://github.com/databricks/cli.git
add some more todos:
This commit is contained in:
parent
75f252e51c
commit
43325fdd0a
|
@ -50,7 +50,8 @@ func New(golangType reflect.Type, docs *Docs) (*jsonschema.Schema, error) {
|
|||
s,
|
||||
{
|
||||
Type: jsonschema.StringType,
|
||||
// TODO:
|
||||
// TODO: Narrow down the scope of the regex match.
|
||||
// Also likely need to rename this variable.
|
||||
Pattern: dynvar.VariableRegex,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -62,11 +62,10 @@ func FromType(typ reflect.Type, opts FromTypeOptions) (Schema, error) {
|
|||
res = Schema{Type: StringType}
|
||||
case reflect.Bool:
|
||||
res = Schema{Type: BooleanType}
|
||||
// case reflect.Int, reflect.Int32, reflect.Int64:
|
||||
// res = Schema{Type: IntegerType}
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
|
||||
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
|
||||
reflect.Float32, reflect.Float64:
|
||||
// TODO: Add comment about reduced coverage of primitive Go types in the code paths here.
|
||||
case reflect.Int:
|
||||
res = Schema{Type: IntegerType}
|
||||
case reflect.Float32, reflect.Float64:
|
||||
res = Schema{Type: NumberType}
|
||||
default:
|
||||
return InvalidSchema, fmt.Errorf("unsupported type: %s", typ.Kind())
|
||||
|
@ -164,6 +163,8 @@ func fromTypeStruct(typ reflect.Type, opts FromTypeOptions) (Schema, error) {
|
|||
return res, nil
|
||||
}
|
||||
|
||||
// TODO: Add comments explaining the translation between struct, map, slice and
|
||||
// the JSON schema representation.
|
||||
func fromTypeSlice(typ reflect.Type, opts FromTypeOptions) (Schema, error) {
|
||||
if typ.Kind() != reflect.Slice {
|
||||
return InvalidSchema, fmt.Errorf("expected slice, got %s", typ.Kind())
|
||||
|
|
Loading…
Reference in New Issue