Skip to content

Commit 6507153

Browse files
Merge branch 'dev' into dependabot/github_actions/docker/build-push-action-7.1.0
2 parents 96d5c0e + eef6ddf commit 6507153

5 files changed

Lines changed: 53 additions & 5 deletions

File tree

.github/workflows/e2e-suite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ jobs:
302302
steps:
303303
- name: Notify Slack
304304
id: main_message
305-
uses: slackapi/slack-github-action@v2
305+
uses: slackapi/slack-github-action@v3
306306
with:
307307
method: chat.postMessage
308308
token: ${{ secrets.SLACK_BOT_TOKEN }}
@@ -334,7 +334,7 @@ jobs:
334334
335335
- name: Test summary thread
336336
if: success()
337-
uses: slackapi/slack-github-action@v2
337+
uses: slackapi/slack-github-action@v3
338338
with:
339339
method: chat.postMessage
340340
token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v6
2222
-
2323
name: Run Labeler
24-
uses: crazy-max/ghaction-github-labeler@24d110aa46a59976b8a7f35518cb7f14f434c916
24+
uses: crazy-max/ghaction-github-labeler@548a7c3603594ec17c819e1239f281a3b801ab4d
2525
with:
2626
github-token: ${{ secrets.GITHUB_TOKEN }}
2727
yaml-file: .github/labels.yml

.github/workflows/nightly-smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Notify Slack
4848
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository
49-
uses: slackapi/slack-github-action@v2
49+
uses: slackapi/slack-github-action@v3
5050
with:
5151
method: chat.postMessage
5252
token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Notify Slack - Main Message
1313
id: main_message
14-
uses: slackapi/slack-github-action@v2
14+
uses: slackapi/slack-github-action@v3
1515
with:
1616
method: chat.postMessage
1717
token: ${{ secrets.SLACK_BOT_TOKEN }}

linodecli/cli.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,56 @@ def _load_openapi_spec(spec_location: str) -> OpenAPI:
305305
with CLI._get_spec_file_reader(spec_location) as f:
306306
parsed = CLI._parse_spec_file(f)
307307

308+
CLI._normalize_content_parameters(parsed)
309+
308310
return OpenAPI(parsed)
309311

312+
@staticmethod
313+
def _normalize_content_parameters(parsed: Dict[str, Any]):
314+
"""
315+
The openapi3 library does not support the OpenAPI 3.0 ``content``
316+
form for Parameter objects. This method converts any such
317+
parameters (in components and inline on paths/operations) to use
318+
a top-level ``schema`` field so they can be parsed normally.
319+
320+
:param parsed: The raw spec dict to mutate in-place.
321+
"""
322+
323+
def _fix_param(param):
324+
if not isinstance(param, dict):
325+
return
326+
if "content" in param and "schema" not in param:
327+
content = param.pop("content")
328+
for media_obj in content.values():
329+
if isinstance(media_obj, dict) and "schema" in media_obj:
330+
param["schema"] = media_obj["schema"]
331+
break
332+
333+
for param in (
334+
parsed.get("components", {}).get("parameters", {}).values()
335+
):
336+
_fix_param(param)
337+
338+
for path_item in parsed.get("paths", {}).values():
339+
if not isinstance(path_item, dict):
340+
continue
341+
for p in path_item.get("parameters", []):
342+
_fix_param(p)
343+
for method in (
344+
"get",
345+
"put",
346+
"post",
347+
"delete",
348+
"options",
349+
"head",
350+
"patch",
351+
"trace",
352+
):
353+
operation = path_item.get(method)
354+
if isinstance(operation, dict):
355+
for p in operation.get("parameters", []):
356+
_fix_param(p)
357+
310358
@staticmethod
311359
@contextlib.contextmanager
312360
def _get_spec_file_reader(

0 commit comments

Comments
 (0)