Skip to content

Commit

Permalink
fix: rename plans query param to categories[]
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mk committed Jan 9, 2024
1 parent 791cc61 commit 5e8e150
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions equinix_metal/equinix_metal/api/plans_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']))
Expand Down
2 changes: 1 addition & 1 deletion metal_openapi.fixed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12187,7 +12187,7 @@ paths:
parameters:
- description: Filter plans by its category
in: query
name: categories
name: categories[]
schema:
items:
enum:
Expand Down
11 changes: 11 additions & 0 deletions scripts/patch_metal_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5e8e150

Please sign in to comment.