Skip to content

Complete support for multipart/form-data HTTP API tests #2606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-03 09:24:16.469657",
"spec_repo_commit": "5906d277"
"regenerated": "2025-06-04 09:15:02.299410",
"spec_repo_commit": "5e0396ec"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-03 09:24:16.484530",
"spec_repo_commit": "5906d277"
"regenerated": "2025-06-04 09:15:02.315323",
"spec_repo_commit": "5e0396ec"
}
}
}
10 changes: 9 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17166,13 +17166,21 @@ components:
description: DNS server port to use for DNS tests.
type: string
files:
description: Files to be used as part of the request in the test.
description: Files to be used as part of the request in the test. Only valid
if `bodyType` is `multipart/form-data`.
items:
$ref: '#/components/schemas/SyntheticsTestRequestBodyFile'
type: array
follow_redirects:
description: Specifies whether or not the request follows redirects.
type: boolean
form:
additionalProperties:
description: A single form entry.
type: string
description: Form to be used as part of the request in the test. Only valid
if `bodyType` is `multipart/form-data`.
type: object
headers:
$ref: '#/components/schemas/SyntheticsTestHeaders'
host:
Expand Down
12 changes: 10 additions & 2 deletions src/datadog_api_client/v1/model/synthetics_test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING
from typing import Dict, List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand Down Expand Up @@ -67,6 +67,7 @@ def openapi_types(_):
"dns_server_port": (str,),
"files": ([SyntheticsTestRequestBodyFile],),
"follow_redirects": (bool,),
"form": ({str: (str,)},),
"headers": (SyntheticsTestHeaders,),
"host": (str,),
"http_version": (SyntheticsTestOptionsHTTPVersion,),
Expand Down Expand Up @@ -100,6 +101,7 @@ def openapi_types(_):
"dns_server_port": "dnsServerPort",
"files": "files",
"follow_redirects": "follow_redirects",
"form": "form",
"headers": "headers",
"host": "host",
"http_version": "httpVersion",
Expand Down Expand Up @@ -143,6 +145,7 @@ def __init__(
dns_server_port: Union[str, UnsetType] = unset,
files: Union[List[SyntheticsTestRequestBodyFile], UnsetType] = unset,
follow_redirects: Union[bool, UnsetType] = unset,
form: Union[Dict[str, str], UnsetType] = unset,
headers: Union[SyntheticsTestHeaders, UnsetType] = unset,
host: Union[str, UnsetType] = unset,
http_version: Union[SyntheticsTestOptionsHTTPVersion, UnsetType] = unset,
Expand Down Expand Up @@ -198,12 +201,15 @@ def __init__(
:param dns_server_port: DNS server port to use for DNS tests.
:type dns_server_port: str, optional

:param files: Files to be used as part of the request in the test.
:param files: Files to be used as part of the request in the test. Only valid if ``bodyType`` is ``multipart/form-data``.
:type files: [SyntheticsTestRequestBodyFile], optional

:param follow_redirects: Specifies whether or not the request follows redirects.
:type follow_redirects: bool, optional

:param form: Form to be used as part of the request in the test. Only valid if ``bodyType`` is ``multipart/form-data``.
:type form: {str: (str,)}, optional

:param headers: Headers to include when performing the test.
:type headers: SyntheticsTestHeaders, optional

Expand Down Expand Up @@ -283,6 +289,8 @@ def __init__(
kwargs["files"] = files
if follow_redirects is not unset:
kwargs["follow_redirects"] = follow_redirects
if form is not unset:
kwargs["form"] = form
if headers is not unset:
kwargs["headers"] = headers
if host is not unset:
Expand Down