Skip to content

Commit 3a64874

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove OpenAPI enum enforcement of Service Definition v2.2 type field from /api/v2/services/definition (#2986)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 2eb512e commit 3a64874

5 files changed

Lines changed: 13 additions & 109 deletions

File tree

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-03-17 14:53:12.008852",
8-
"spec_repo_commit": "f73f9d61"
7+
"regenerated": "2025-03-17 17:20:28.246488",
8+
"spec_repo_commit": "29344bf2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-17 14:53:12.024999",
13-
"spec_repo_commit": "f73f9d61"
12+
"regenerated": "2025-03-17 17:20:28.261938",
13+
"spec_repo_commit": "29344bf2"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29902,24 +29902,8 @@ components:
2990229902
type: object
2990329903
ServiceDefinitionV2Dot2Type:
2990429904
description: The type of service.
29905-
enum:
29906-
- web
29907-
- db
29908-
- cache
29909-
- function
29910-
- browser
29911-
- mobile
29912-
- custom
2991329905
example: web
2991429906
type: string
29915-
x-enum-varnames:
29916-
- WEB
29917-
- DB
29918-
- CACHE
29919-
- FUNCTION
29920-
- BROSWER
29921-
- MOBILE
29922-
- CUSTOM
2992329907
ServiceDefinitionV2Dot2Version:
2992429908
default: v2.2
2992529909
description: Schema version being used.

api/datadogV2/model_service_definition_v2_dot2.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ServiceDefinitionV2Dot2 struct {
4141
// Importance of the service.
4242
Tier *string `json:"tier,omitempty"`
4343
// The type of service.
44-
Type *ServiceDefinitionV2Dot2Type `json:"type,omitempty"`
44+
Type *string `json:"type,omitempty"`
4545
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
4646
UnparsedObject map[string]interface{} `json:"-"`
4747
AdditionalProperties map[string]interface{} `json:"-"`
@@ -451,17 +451,17 @@ func (o *ServiceDefinitionV2Dot2) SetTier(v string) {
451451
}
452452

453453
// GetType returns the Type field value if set, zero value otherwise.
454-
func (o *ServiceDefinitionV2Dot2) GetType() ServiceDefinitionV2Dot2Type {
454+
func (o *ServiceDefinitionV2Dot2) GetType() string {
455455
if o == nil || o.Type == nil {
456-
var ret ServiceDefinitionV2Dot2Type
456+
var ret string
457457
return ret
458458
}
459459
return *o.Type
460460
}
461461

462462
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
463463
// and a boolean to check if the value has been set.
464-
func (o *ServiceDefinitionV2Dot2) GetTypeOk() (*ServiceDefinitionV2Dot2Type, bool) {
464+
func (o *ServiceDefinitionV2Dot2) GetTypeOk() (*string, bool) {
465465
if o == nil || o.Type == nil {
466466
return nil, false
467467
}
@@ -473,8 +473,8 @@ func (o *ServiceDefinitionV2Dot2) HasType() bool {
473473
return o != nil && o.Type != nil
474474
}
475475

476-
// SetType gets a reference to the given ServiceDefinitionV2Dot2Type and assigns it to the Type field.
477-
func (o *ServiceDefinitionV2Dot2) SetType(v ServiceDefinitionV2Dot2Type) {
476+
// SetType gets a reference to the given string and assigns it to the Type field.
477+
func (o *ServiceDefinitionV2Dot2) SetType(v string) {
478478
o.Type = &v
479479
}
480480

@@ -549,7 +549,7 @@ func (o *ServiceDefinitionV2Dot2) UnmarshalJSON(bytes []byte) (err error) {
549549
Tags []string `json:"tags,omitempty"`
550550
Team *string `json:"team,omitempty"`
551551
Tier *string `json:"tier,omitempty"`
552-
Type *ServiceDefinitionV2Dot2Type `json:"type,omitempty"`
552+
Type *string `json:"type,omitempty"`
553553
}{}
554554
if err = datadog.Unmarshal(bytes, &all); err != nil {
555555
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -589,11 +589,7 @@ func (o *ServiceDefinitionV2Dot2) UnmarshalJSON(bytes []byte) (err error) {
589589
o.Tags = all.Tags
590590
o.Team = all.Team
591591
o.Tier = all.Tier
592-
if all.Type != nil && !all.Type.IsValid() {
593-
hasInvalidField = true
594-
} else {
595-
o.Type = all.Type
596-
}
592+
o.Type = all.Type
597593

598594
if len(additionalProperties) > 0 {
599595
o.AdditionalProperties = additionalProperties

api/datadogV2/model_service_definition_v2_dot2_type.go

Lines changed: 0 additions & 76 deletions
This file was deleted.

examples/v2/service-definition/CreateOrUpdateServiceDefinitions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func main() {
6767
},
6868
Team: datadog.PtrString("my-team"),
6969
Tier: datadog.PtrString("High"),
70-
Type: datadogV2.SERVICEDEFINITIONV2DOT2TYPE_WEB.Ptr(),
70+
Type: datadog.PtrString("web"),
7171
}}
7272
ctx := datadog.NewDefaultContext(context.Background())
7373
configuration := datadog.NewConfiguration()

0 commit comments

Comments
 (0)