Skip to content

Commit 2f390a7

Browse files
committed
remove compatible models from brick instance list endpoint
1 parent 12a78db commit 2f390a7

File tree

4 files changed

+55
-5
lines changed

4 files changed

+55
-5
lines changed

internal/api/docs/openapi.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ components:
11921192
properties:
11931193
bricks:
11941194
items:
1195-
$ref: '#/components/schemas/BrickInstance'
1195+
$ref: '#/components/schemas/BrickInstanceListItem'
11961196
nullable: true
11971197
type: array
11981198
type: object
@@ -1380,6 +1380,31 @@ components:
13801380
for backward compatibility.'
13811381
type: object
13821382
type: object
1383+
BrickInstanceListItem:
1384+
properties:
1385+
author:
1386+
type: string
1387+
category:
1388+
type: string
1389+
config_variables:
1390+
items:
1391+
$ref: '#/components/schemas/BrickConfigVariable'
1392+
type: array
1393+
id:
1394+
type: string
1395+
model:
1396+
type: string
1397+
name:
1398+
type: string
1399+
status:
1400+
type: string
1401+
variables:
1402+
additionalProperties:
1403+
type: string
1404+
description: 'Deprecated: use config_variables instead. This field is kept
1405+
for backward compatibility.'
1406+
type: object
1407+
type: object
13831408
BrickListItem:
13841409
properties:
13851410
author:

internal/e2e/client/client.gen.go

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/orchestrator/bricks/bricks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (s *Service) List() (BrickListResult, error) {
7171
}
7272

7373
func (s *Service) AppBrickInstancesList(a *app.ArduinoApp) (AppBrickInstancesResult, error) {
74-
res := AppBrickInstancesResult{BrickInstances: make([]BrickInstance, len(a.Descriptor.Bricks))}
74+
res := AppBrickInstancesResult{BrickInstances: make([]BrickInstanceListItem, len(a.Descriptor.Bricks))}
7575
for i, brickInstance := range a.Descriptor.Bricks {
7676
brick, found := s.bricksIndex.FindBrickByID(brickInstance.ID)
7777
if !found {
@@ -80,7 +80,7 @@ func (s *Service) AppBrickInstancesList(a *app.ArduinoApp) (AppBrickInstancesRes
8080

8181
variablesMap, configVariables := getBrickConfigDetails(brick, brickInstance.Variables)
8282

83-
res.BrickInstances[i] = BrickInstance{
83+
res.BrickInstances[i] = BrickInstanceListItem{
8484
ID: brick.ID,
8585
Name: brick.Name,
8686
Author: "Arduino", // TODO: for now we only support our bricks

internal/orchestrator/bricks/types.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@ type BrickListItem struct {
3030
}
3131

3232
type AppBrickInstancesResult struct {
33-
BrickInstances []BrickInstance `json:"bricks"`
33+
BrickInstances []BrickInstanceListItem `json:"bricks"`
34+
}
35+
36+
type BrickInstanceListItem struct {
37+
ID string `json:"id"`
38+
Name string `json:"name"`
39+
Author string `json:"author"`
40+
Category string `json:"category"`
41+
Status string `json:"status"`
42+
Variables map[string]string `json:"variables,omitempty" description:"Deprecated: use config_variables instead. This field is kept for backward compatibility."`
43+
ConfigVariables []BrickConfigVariable `json:"config_variables,omitempty"`
44+
ModelID string `json:"model,omitempty"`
3445
}
3546

3647
type BrickInstance struct {

0 commit comments

Comments
 (0)