Skip to content

Additional rules to inject openapi type #525

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

Merged
Merged
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-02-18 20:22:49.545750",
"spec_repo_commit": "c8707cdc"
"regenerated": "2025-02-18 22:25:34.178570",
"spec_repo_commit": "98988fd6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-18 20:22:49.563211",
"spec_repo_commit": "c8707cdc"
"regenerated": "2025-02-18 22:25:34.194004",
"spec_repo_commit": "98988fd6"
}
}
}
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,7 @@ components:
type: array
required:
- exclude_only
type: object
AWSNamespaceFiltersIncludeOnly:
description: Include only these namespaces.
properties:
Expand All @@ -1543,6 +1544,7 @@ components:
type: array
required:
- include_only
type: object
AWSNamespaceTagFilter:
description: 'AWS Metrics Collection tag filters list. Defaults to `[]`.

Expand Down Expand Up @@ -1676,6 +1678,7 @@ components:
type: boolean
required:
- include_all
type: object
AWSRegionsIncludeOnly:
description: Include only these regions.
properties:
Expand All @@ -1689,6 +1692,7 @@ components:
type: array
required:
- include_only
type: object
AWSResourcesConfig:
description: AWS Resources Collection config.
properties:
Expand Down Expand Up @@ -10934,13 +10938,15 @@ components:
definition:
description: The API definition.
type: object
type: object
EntityV3APISpecInterfaceFileRef:
additionalProperties: false
description: The definition of `EntityV3APISpecInterfaceFileRef` object.
properties:
fileRef:
description: The reference to the API definition file.
type: string
type: object
EntityV3APIVersion:
description: The schema version of entity type. The field is known as schema-version
in the previous version.
Expand Down Expand Up @@ -11206,6 +11212,7 @@ components:
type: string
required:
- name
type: object
EntityV3MetadataContactsItems:
additionalProperties: false
description: The definition of Entity V3 Metadata Contacts Items object.
Expand Down Expand Up @@ -20228,6 +20235,7 @@ components:
$ref: '#/components/schemas/OktaAccountUpdateRequestAttributes'
type:
$ref: '#/components/schemas/OktaAccountType'
type: object
OktaAccountsResponse:
description: The expected response schema when getting Okta accounts.
properties:
Expand Down Expand Up @@ -25939,6 +25947,7 @@ components:
description: The version of the rule.
format: int64
type: integer
type: object
SecurityMonitoringSignalRuleResponseQuery:
description: Query for matching rule on signals.
properties:
Expand Down Expand Up @@ -26475,6 +26484,7 @@ components:
description: The version of the rule.
format: int64
type: integer
type: object
SecurityMonitoringStandardRuleTestPayload:
description: The payload of a rule to test
properties:
Expand Down Expand Up @@ -32266,6 +32276,7 @@ components:
type: boolean
required:
- include_all
type: object
XRayServicesIncludeOnly:
description: Include only these services. Defaults to `[]`.
nullable: true
Expand All @@ -32280,6 +32291,7 @@ components:
type: array
required:
- include_only
type: object
XRayServicesList:
description: AWS X-Ray services to collect traces from. Defaults to `include_only`.
oneOf:
Expand Down
5 changes: 4 additions & 1 deletion examples/v2_software-catalog_UpsertCatalogEntity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use datadog_api_client::datadogV2::model::EntityV3DatadogPerformance;
use datadog_api_client::datadogV2::model::EntityV3DatadogPipelines;
use datadog_api_client::datadogV2::model::EntityV3Integrations;
use datadog_api_client::datadogV2::model::EntityV3Metadata;
use datadog_api_client::datadogV2::model::EntityV3MetadataAdditionalOwnersItems;
use datadog_api_client::datadogV2::model::EntityV3MetadataContactsItems;
use datadog_api_client::datadogV2::model::EntityV3MetadataLinksItems;
use datadog_api_client::datadogV2::model::EntityV3Service;
Expand All @@ -27,7 +28,9 @@ async fn main() {
EntityV3APIVersion::V3,
EntityV3ServiceKind::SERVICE,
EntityV3Metadata::new("myService".to_string())
.additional_owners(vec![])
.additional_owners(vec![EntityV3MetadataAdditionalOwnersItems::new(
"".to_string(),
)])
.contacts(vec![EntityV3MetadataContactsItems::new(
"https://slack/".to_string(),
"slack".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/features/v2/okta_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ Feature: Okta Integration
Scenario: Update Okta account returns "Bad Request" response
Given new "UpdateOktaAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {}
And body with value {"data": {"attributes": {"auth_method": "oauth", "domain": "https://dev-test.okta.com/"}, "type": "okta-accounts"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Update Okta account returns "Not Found" response
Given new "UpdateOktaAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {}
And body with value {"data": {"attributes": {"auth_method": "oauth", "domain": "https://dev-test.okta.com/"}, "type": "okta-accounts"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/features/v2/software_catalog.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Feature: Software Catalog
@generated @skip @team:DataDog/service-catalog
Scenario: Create or update entities returns "ACCEPTED" response
Given new "UpsertCatalogEntity" request
And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"dependsOn": [], "languages": []}}
And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"dependsOn": [], "languages": []}}
When the request is sent
Then the response status is 202 ACCEPTED

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update entities returns "Bad Request" response
Given new "UpsertCatalogEntity" request
And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"dependsOn": [], "languages": []}}
And body with value {"apiVersion": "v3", "datadog": {"codeLocations": [{"paths": []}], "events": [{}], "logs": [{}], "performanceData": {"tags": []}, "pipelines": {"fingerprints": []}}, "integrations": {"opsgenie": {"serviceURL": "https://www.opsgenie.com/service/shopping-cart"}, "pagerduty": {"serviceURL": "https://www.pagerduty.com/service-directory/Pshopping-cart"}}, "kind": "service", "metadata": {"additionalOwners": [{"name": ""}], "contacts": [{"contact": "https://slack/", "type": "slack"}], "id": "4b163705-23c0-4573-b2fb-f6cea2163fcb", "inheritFrom": "application:default/myapp", "links": [{"name": "mylink", "type": "link", "url": "https://mylink"}], "name": "myService", "namespace": "default", "tags": ["this:tag", "that:tag"]}, "spec": {"dependsOn": [], "languages": []}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down
Loading