Skip to content

Commit 43738c2

Browse files
committed
fix: remove duplicate filterQuery parameter and regenerate OpenAPI files
Signed-off-by: Sidney Glinton <[email protected]>
1 parent 67300cb commit 43738c2

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

catalog/internal/server/openapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type ModelCatalogServiceAPIRouter interface {
3333
// while the service implementation can be ignored with the .openapi-generator-ignore file
3434
// and updated with the logic required for the API.
3535
type ModelCatalogServiceAPIServicer interface {
36-
FindModels(context.Context, []string, string, string, string, model.OrderByField, model.SortOrder, string, string) (ImplResponse, error)
36+
FindModels(context.Context, []string, string, string, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
3737
FindModelsFilterOptions(context.Context) (ImplResponse, error)
3838
FindSources(context.Context, string, string, model.OrderByField, model.SortOrder, string) (ImplResponse, error)
3939
GetAllModelArtifacts(context.Context, string, string, string, model.OrderByField, model.SortOrder, string, string) (ImplResponse, error)

catalog/internal/server/openapi/api_model_catalog_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ func (c *ModelCatalogServiceAPIController) FindModels(w http.ResponseWriter, r *
8686
sourceParam := strings.Split(query.Get("source"), ",")
8787
sourceLabelParam := query.Get("sourceLabel")
8888
qParam := query.Get("q")
89+
filterQueryParam := query.Get("filterQuery")
8990
pageSizeParam := query.Get("pageSize")
9091
orderByParam := query.Get("orderBy")
9192
sortOrderParam := query.Get("sortOrder")
9293
nextPageTokenParam := query.Get("nextPageToken")
93-
filterQueryParam := query.Get("filterQuery")
94-
result, err := c.service.FindModels(r.Context(), sourceParam, sourceLabelParam, qParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam, filterQueryParam)
94+
result, err := c.service.FindModels(r.Context(), sourceParam, sourceLabelParam, qParam, filterQueryParam, pageSizeParam, model.OrderByField(orderByParam), model.SortOrder(sortOrderParam), nextPageTokenParam)
9595
// If an error occurred, encode the error with the status code
9696
if err != nil {
9797
c.errorHandler(w, r, err, &result)

catalog/internal/server/openapi/api_model_catalog_service_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (m *ModelCatalogServiceAPIService) GetAllModelArtifacts(ctx context.Context
6464
return Response(http.StatusOK, artifacts), nil
6565
}
6666

67-
func (m *ModelCatalogServiceAPIService) FindModels(ctx context.Context, sourceIDs []string, sourceLabel string, q string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string, filterQuery string) (ImplResponse, error) {
67+
func (m *ModelCatalogServiceAPIService) FindModels(ctx context.Context, sourceIDs []string, sourceLabel string, q string, filterQuery string, pageSize string, orderBy model.OrderByField, sortOrder model.SortOrder, nextPageToken string) (ImplResponse, error) {
6868
var err error
6969
pageSizeInt := int32(10)
7070

catalog/internal/server/openapi/api_model_catalog_service_service_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ func TestFindModels(t *testing.T) {
307307
[]string{tc.sourceID},
308308
"", // sourceLabel
309309
tc.q,
310+
tc.filterQuery,
310311
tc.pageSize,
311312
tc.orderBy,
312313
tc.sortOrder,
313314
tc.nextPageToken,
314-
tc.filterQuery,
315315
)
316316

317317
assert.Equal(t, tc.expectedStatus, resp.Code)

catalog/internal/server/openapi/type_asserts.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@ func AssertFilterOptionRequired(obj model.FilterOption) error {
283283
}
284284
}
285285

286-
if obj.Range != nil {
287-
if err := AssertFilterOptionRangeRequired(*obj.Range); err != nil {
288-
return err
289-
}
286+
if err := AssertFilterOptionRangeRequired(obj.Range); err != nil {
287+
return err
290288
}
291289
return nil
292290
}

catalog/pkg/openapi/api_model_catalog_service.go

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)