mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Update oapi-codegen library (#62962)
* Update oapi library and thema * Use fork commit to fix elasticsearch and cloudwatch generators * Update thema * Fixes * Update thema with last fixes * Sync * Fix test * Update thema and schemas * Update thema
This commit is contained in:
@@ -83,7 +83,7 @@ func (s *Service) Get(ctx context.Context, q *playlist.GetPlaylistByUidQuery) (*
|
||||
Uid: v.UID,
|
||||
Name: v.Name,
|
||||
Interval: v.Interval,
|
||||
Items: &items,
|
||||
Items: items,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -31,17 +31,17 @@ func summaryBuilder(ctx context.Context, uid string, body []byte) (*entity.Entit
|
||||
// TODO: fix model so this is not possible
|
||||
if obj.Items == nil {
|
||||
temp := make([]playlist.Item, 0)
|
||||
obj.Items = &temp
|
||||
obj.Items = temp
|
||||
}
|
||||
|
||||
obj.Uid = uid // make sure they are consistent
|
||||
summary := &entity.EntitySummary{
|
||||
UID: uid,
|
||||
Name: obj.Name,
|
||||
Description: fmt.Sprintf("%d items, refreshed every %s", len(*obj.Items), obj.Interval),
|
||||
Description: fmt.Sprintf("%d items, refreshed every %s", len(obj.Items), obj.Interval),
|
||||
}
|
||||
|
||||
for _, item := range *obj.Items {
|
||||
for _, item := range obj.Items {
|
||||
switch item.Type {
|
||||
case playlist.ItemTypeDashboardByUid:
|
||||
summary.References = append(summary.References, &entity.EntityExternalReference{
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestPlaylistSummary(t *testing.T) {
|
||||
playlist := playlist.Playlist{
|
||||
Interval: "30s",
|
||||
Name: "test",
|
||||
Items: &[]playlist.Item{
|
||||
Items: []playlist.Item{
|
||||
{Type: playlist.ItemTypeDashboardByUid, Value: "D1"},
|
||||
{Type: playlist.ItemTypeDashboardByTag, Value: "tagA"},
|
||||
{Type: playlist.ItemTypeDashboardByUid, Value: "D3"},
|
||||
|
||||
Reference in New Issue
Block a user