Skip to content

Commit d7c3ff3

Browse files
committed
shadowed import and unnecessary type convert
1 parent 5980634 commit d7c3ff3

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/cmd/model/schema.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func newSchemaCmd(_ *log.Logger) *cobra.Command {
170170
spin := cmdutil.NewSpinner("Fetching model schema...")
171171
spin.Start()
172172

173-
schema, err := api.FetchModelSchema(cmd.Context(), air)
173+
modelSchema, err := api.FetchModelSchema(cmd.Context(), air)
174174
if err != nil {
175175
spin.Stop()
176176
return err
@@ -181,13 +181,13 @@ func newSchemaCmd(_ *log.Logger) *cobra.Command {
181181

182182
// For JSON/YAML emit the full envelope unchanged.
183183
if format != output.FormatTable {
184-
return output.Print(format, schema)
184+
return output.Print(format, modelSchema)
185185
}
186186

187187
// For table, parse the selected schema and build indented rows.
188-
selected := schema.RequestSchema
188+
selected := modelSchema.RequestSchema
189189
if flags.response {
190-
selected = schema.ResponseSchema
190+
selected = modelSchema.ResponseSchema
191191
}
192192

193193
var node schemaNode
@@ -200,8 +200,8 @@ func newSchemaCmd(_ *log.Logger) *cobra.Command {
200200
return err
201201
}
202202

203-
if schema.Documentation != "" {
204-
fmt.Fprintf(os.Stderr, "Docs: %s\n", schema.Documentation)
203+
if modelSchema.Documentation != "" {
204+
fmt.Fprintf(os.Stderr, "Docs: %s\n", modelSchema.Documentation)
205205
}
206206

207207
return nil

internal/schema/schema.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (t *SchemaType) UnmarshalJSON(b []byte) error {
3333
switch val := v.(type) {
3434
case string:
3535
if val == "null" {
36-
*t = SchemaType("")
36+
*t = ""
3737
} else {
3838
*t = SchemaType(val)
3939
}
@@ -44,7 +44,7 @@ func (t *SchemaType) UnmarshalJSON(b []byte) error {
4444
return nil
4545
}
4646
}
47-
*t = SchemaType("")
47+
*t = ""
4848
default:
4949
return fmt.Errorf("schema type: expected string or array, got %T", v)
5050
}

0 commit comments

Comments
 (0)