diff --git a/equinix_metal/equinix_metal/api/plans_api.py b/equinix_metal/equinix_metal/api/plans_api.py index dd2662e3..5ed9b192 100644 --- a/equinix_metal/equinix_metal/api/plans_api.py +++ b/equinix_metal/equinix_metal/api/plans_api.py @@ -168,8 +168,8 @@ def find_plans_with_http_info(self, categories : Annotated[Optional[conlist(Stri # process the query parameters _query_params = [] if _params.get('categories') is not None: # noqa: E501 - _query_params.append(('categories', _params['categories'])) - _collection_formats['categories'] = 'multi' + _query_params.append(('categories[]', _params['categories'])) + _collection_formats['categories[]'] = 'multi' if _params.get('type') is not None: # noqa: E501 _query_params.append(('type', _params['type'])) diff --git a/metal_openapi.fixed.yaml b/metal_openapi.fixed.yaml index b2fc5d6a..9e9ff35b 100644 --- a/metal_openapi.fixed.yaml +++ b/metal_openapi.fixed.yaml @@ -12187,7 +12187,7 @@ paths: parameters: - description: Filter plans by its category in: query - name: categories + name: categories[] schema: items: enum: diff --git a/scripts/patch_metal_spec.py b/scripts/patch_metal_spec.py index 1dfc4114..a31f6f08 100755 --- a/scripts/patch_metal_spec.py +++ b/scripts/patch_metal_spec.py @@ -84,6 +84,17 @@ def loadYaml(fn): del fixedSpec['components']['schemas']['Plan_specs_drives_inner']['properties']['type']['enum'] del fixedSpec['components']['schemas']['Plan_specs_nics_inner']['properties']['type']['enum'] +# FIX 13. rename query attribute categories to "categories[]" + +plans_get_params = fixedSpec['paths']['/plans']['get']['parameters'] + +for i, p in enumerate(plans_get_params): + if p['name'] == 'categories': + fixedSpec['paths']['/plans']['get']['parameters'][i]['name'] = "categories[]" + break + + + # Mark paginated operation with `x-equinix-metal-paginated-property` refkey = "$ref"