Skip to content
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

Add required fields for included items in the response of ListCatalogEntity #2768

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-03-18 16:20:36.363534",
"spec_repo_commit": "78376979"
"regenerated": "2025-03-21 17:04:19.883447",
"spec_repo_commit": "94f7c372"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-03-18 16:20:36.379301",
"spec_repo_commit": "78376979"
"regenerated": "2025-03-21 17:04:19.899185",
"spec_repo_commit": "94f7c372"
}
}
}
18 changes: 17 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11968,7 +11968,10 @@ components:
properties:
rawSchema:
description: Schema from user input in base64 encoding.
example: b3BlbmFwaTogMy4wLjQKaW5mbzoKICB0aXRsZTogU2FtcGxlIEFQSQogIHZlcnNpb246IDAuMS45Cg==
type: string
required:
- rawSchema
type: object
EntityResponseIncludedRelatedEntity:
description: Included related entity.
Expand All @@ -11989,16 +11992,21 @@ components:
properties:
kind:
description: Entity kind.
example: team
type: string
name:
description: Entity name.
example: bits-ai
type: string
namespace:
description: Entity namespace.
type: string
type:
description: Entity relation type to the associated entity.
type: string
required:
- kind
- name
type: object
EntityResponseIncludedRelatedEntityMeta:
description: Included related entity meta.
Expand Down Expand Up @@ -12036,7 +12044,10 @@ components:
type: string
title:
description: Incident title.
example: fake-incident-title
type: string
required:
- title
type: object
EntityResponseIncludedRelatedOncallAttributes:
description: Included related oncall attributes.
Expand All @@ -12045,7 +12056,10 @@ components:
$ref: '#/components/schemas/EntityResponseIncludedRelatedOncallEscalations'
provider:
description: Oncall provider.
example: pagerduty
type: string
required:
- provider
type: object
EntityResponseIncludedRelatedOncallEscalationItem:
description: Oncall escalation.
Expand Down Expand Up @@ -12083,6 +12097,8 @@ components:
properties:
schema:
$ref: '#/components/schemas/EntityV3'
required:
- schema
type: object
EntityResponseMeta:
description: Entity metadata.
Expand Down Expand Up @@ -12486,7 +12502,7 @@ components:
properties:
name:
description: Team name.
example: ''
example: fake-team-name
type: string
type:
description: Team type.
Expand Down
3 changes: 2 additions & 1 deletion examples/v2/software-catalog/UpsertCatalogEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public static void main(String[] args) {
new EntityV3Metadata()
.additionalOwners(
Collections.singletonList(
new EntityV3MetadataAdditionalOwnersItems().name("")))
new EntityV3MetadataAdditionalOwnersItems()
.name("fake-team-name")))
.contacts(
Collections.singletonList(
new EntityV3MetadataContactsItems()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -25,6 +26,14 @@ public class EntityResponseIncludedRawSchemaAttributes {
public static final String JSON_PROPERTY_RAW_SCHEMA = "rawSchema";
private String rawSchema;

public EntityResponseIncludedRawSchemaAttributes() {}

@JsonCreator
public EntityResponseIncludedRawSchemaAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_RAW_SCHEMA) String rawSchema) {
this.rawSchema = rawSchema;
}

public EntityResponseIncludedRawSchemaAttributes rawSchema(String rawSchema) {
this.rawSchema = rawSchema;
return this;
Expand All @@ -35,9 +44,8 @@ public EntityResponseIncludedRawSchemaAttributes rawSchema(String rawSchema) {
*
* @return rawSchema
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RAW_SCHEMA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getRawSchema() {
return rawSchema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -39,6 +40,16 @@ public class EntityResponseIncludedRelatedEntityAttributes {
public static final String JSON_PROPERTY_TYPE = "type";
private String type;

public EntityResponseIncludedRelatedEntityAttributes() {}

@JsonCreator
public EntityResponseIncludedRelatedEntityAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_KIND) String kind,
@JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) {
this.kind = kind;
this.name = name;
}

public EntityResponseIncludedRelatedEntityAttributes kind(String kind) {
this.kind = kind;
return this;
Expand All @@ -49,9 +60,8 @@ public EntityResponseIncludedRelatedEntityAttributes kind(String kind) {
*
* @return kind
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_KIND)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getKind() {
return kind;
}
Expand All @@ -70,9 +80,8 @@ public EntityResponseIncludedRelatedEntityAttributes name(String name) {
*
* @return name
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -44,6 +45,14 @@ public class EntityResponseIncludedRelatedIncidentAttributes {
public static final String JSON_PROPERTY_TITLE = "title";
private String title;

public EntityResponseIncludedRelatedIncidentAttributes() {}

@JsonCreator
public EntityResponseIncludedRelatedIncidentAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) {
this.title = title;
}

public EntityResponseIncludedRelatedIncidentAttributes createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
Expand Down Expand Up @@ -138,9 +147,8 @@ public EntityResponseIncludedRelatedIncidentAttributes title(String title) {
*
* @return title
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TITLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getTitle() {
return title;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -33,6 +34,14 @@ public class EntityResponseIncludedRelatedOncallAttributes {
public static final String JSON_PROPERTY_PROVIDER = "provider";
private String provider;

public EntityResponseIncludedRelatedOncallAttributes() {}

@JsonCreator
public EntityResponseIncludedRelatedOncallAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_PROVIDER) String provider) {
this.provider = provider;
}

public EntityResponseIncludedRelatedOncallAttributes escalations(
List<EntityResponseIncludedRelatedOncallEscalationItem> escalations) {
this.escalations = escalations;
Expand Down Expand Up @@ -78,9 +87,8 @@ public EntityResponseIncludedRelatedOncallAttributes provider(String provider) {
*
* @return provider
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PROVIDER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getProvider() {
return provider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -25,6 +26,15 @@ public class EntityResponseIncludedSchemaAttributes {
public static final String JSON_PROPERTY_SCHEMA = "schema";
private EntityV3 schema;

public EntityResponseIncludedSchemaAttributes() {}

@JsonCreator
public EntityResponseIncludedSchemaAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_SCHEMA) EntityV3 schema) {
this.schema = schema;
this.unparsed |= schema.unparsed;
}

public EntityResponseIncludedSchemaAttributes schema(EntityV3 schema) {
this.schema = schema;
this.unparsed |= schema.unparsed;
Expand All @@ -36,9 +46,8 @@ public EntityResponseIncludedSchemaAttributes schema(EntityV3 schema) {
*
* @return schema
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SCHEMA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public EntityV3 getSchema() {
return schema;
}
Expand Down
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": [{"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": []}}
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": "fake-team-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": [{"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": []}}
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": "fake-team-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