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:
Selene
2023-02-21 12:34:24 +01:00
committed by GitHub
parent 5ca8ea40c1
commit 7ace44c8b5
22 changed files with 971 additions and 929 deletions

View File

@@ -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
}

View File

@@ -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{

View File

@@ -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"},