diff --git a/openapi/v2/openapi-2025-03-12.json b/openapi/v2/openapi-2025-03-12.json index 72af803272..282a9a1147 100644 --- a/openapi/v2/openapi-2025-03-12.json +++ b/openapi/v2/openapi-2025-03-12.json @@ -32854,24 +32854,6 @@ }, "ApiSearchDeploymentResponseView": { "properties": { - "encryptionAtRestProvider": { - "description": "Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster.", - "enum": [ - "NONE", - "AWS", - "AZURE", - "GCP" - ], - "externalDocs": { - "description": "Encryption at Rest using Customer Key Management", - "url": "https://www.mongodb.com/docs/atlas/security-kms-encryption/" - }, - "readOnly": true, - "type": "string", - "x-xgen-hidden-env": { - "envs": "qa,prod,stage" - } - }, "groupId": { "description": "Unique 24-hexadecimal character string that identifies the project.", "example": "32b6e34b3d91647abb20e7b8", @@ -47586,14 +47568,6 @@ "azureKeyVault": { "$ref": "#/components/schemas/AzureKeyVault" }, - "enabledForSearchNodes": { - "description": "Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project.", - "nullable": true, - "type": "boolean", - "x-xgen-hidden-env": { - "envs": "qa,prod,stage" - } - }, "googleCloudKms": { "$ref": "#/components/schemas/GoogleCloudKMS" } diff --git a/tools/cli/internal/openapi/filter/hidden_envs.go b/tools/cli/internal/openapi/filter/hidden_envs.go index 2eb0a068d7..eca2c084d0 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs.go +++ b/tools/cli/internal/openapi/filter/hidden_envs.go @@ -50,9 +50,87 @@ func (f *HiddenEnvsFilter) Apply() error { f.oas.Paths.Delete(path) } } + + if f.oas.Components == nil || f.oas.Components.Schemas == nil { + return nil + } + + return f.applyOnSchemas(f.oas.Components.Schemas) +} + +func (f *HiddenEnvsFilter) applyOnSchemas(schemas openapi3.Schemas) error { + for name, schema := range schemas { + if err := f.removeSchemaIfHiddenForEnv(name, schema, schemas); err != nil { + return err + } + } + return nil +} + +func (f *HiddenEnvsFilter) removeSchemaIfHiddenForEnv(name string, schema *openapi3.SchemaRef, schemas openapi3.Schemas) error { + if schema == nil { + return nil + } + + // Remove the schema if it is hidden for the target environment + if extension, ok := schema.Extensions[hiddenEnvsExtension]; ok { + log.Printf("Found x-hidden-envs in schema: K: %q, V: %q", hiddenEnvsExtension, extension) + if isHiddenExtensionEqualToTargetEnv(extension, f.metadata.targetEnv) { + log.Printf("Removing schema: %q because is hidden for target env: %q", name, f.metadata.targetEnv) + delete(schemas, name) + return nil + } + + // Remove the Hidden extension from the final OAS + delete(schema.Extensions, hiddenEnvsExtension) + } + + if schema.Value == nil { + return nil + } + + if schema.Value.Extensions != nil { + if extension, ok := schema.Value.Extensions[hiddenEnvsExtension]; ok { + log.Printf("Found x-hidden-envs in schema: K: %q, V: %q", hiddenEnvsExtension, extension) + if isHiddenExtensionEqualToTargetEnv(extension, f.metadata.targetEnv) { + log.Printf("Removing schema: %q because is hidden for target env: %q", name, f.metadata.targetEnv) + delete(schemas, name) + return nil + } + + // Remove the Hidden extension from the final OAS + delete(schema.Value.Extensions, hiddenEnvsExtension) + } + } + + // Remove properties and items if they are hidden for the target environment + if schema.Value.Properties != nil { + if err := f.applyOnSchemas(schema.Value.Properties); err != nil { + return err + } + } + + f.removeItemsIfHiddenForEnv(schema) return nil } +func (f *HiddenEnvsFilter) removeItemsIfHiddenForEnv(schema *openapi3.SchemaRef) { + if schema.Value == nil || schema.Value.Items == nil { + return + } + + if extension, ok := schema.Value.Items.Extensions[hiddenEnvsExtension]; ok { + log.Printf("Found x-hidden-envs in items: K: %q, V: %q", hiddenEnvsExtension, extension) + if isHiddenExtensionEqualToTargetEnv(extension, f.metadata.targetEnv) { + log.Printf("Removing items because is hidden for target env: %q", f.metadata.targetEnv) + schema.Value.Items = nil + } else { + // Remove the Hidden extension from the final OAS + delete(schema.Value.Items.Extensions, hiddenEnvsExtension) + } + } +} + func (f *HiddenEnvsFilter) applyOnPath(pathItem *openapi3.PathItem) error { for k, operation := range pathItem.Operations() { f.removeOperationIfHiddenForEnv(k, pathItem, operation) diff --git a/tools/cli/internal/openapi/filter/hidden_envs_test.go b/tools/cli/internal/openapi/filter/hidden_envs_test.go index e823c892cd..1e2344ee4a 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs_test.go +++ b/tools/cli/internal/openapi/filter/hidden_envs_test.go @@ -728,6 +728,293 @@ func TestRemoveResponseIfHiddenForEnv(t *testing.T) { }) } } + +func TestApplyOnSchemas(t *testing.T) { + tests := []struct { + name string + schemas openapi3.Schemas + targetEnv string + expected openapi3.Schemas + }{ + { + name: "Remove schema hidden for target environment", + schemas: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "schema2": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "dev", + }, + }, + }, + }, + targetEnv: "prod", + expected: openapi3.Schemas{ + "schema2": { + Extensions: map[string]any{}, + }, + }, + }, + { + name: "Remove properties hidden for target environment", + schemas: openapi3.Schemas{ + "schema1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "property2": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "dev", + }, + }, + }, + }, + }, + }, + }, + targetEnv: "prod", + expected: openapi3.Schemas{ + "schema1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + }, + { + name: "Remove properties of properties hidden for target environment", + schemas: openapi3.Schemas{ + "schema1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "subProperty1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "subProperty2": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "dev", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + targetEnv: "prod", + expected: openapi3.Schemas{ + "schema1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "subProperty2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "Retain schemas and properties not hidden for target environment", + schemas: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "dev", + }, + }, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "dev", + }, + }, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + targetEnv: "prod", + expected: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{}, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{}, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + }, + { + name: "Remove hidden environment extension from final OAS", + schemas: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + targetEnv: "dev", + expected: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{}, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{}, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + }, + { + name: "Remove hidden environment extension from final OAS", + schemas: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + targetEnv: "dev", + expected: openapi3.Schemas{ + "schema1": { + Extensions: map[string]any{}, + }, + "schema2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "property1": { + Extensions: map[string]any{}, + }, + "property2": { + Extensions: map[string]any{}, + }, + }, + }, + }, + }, + }, + { + name: "Remove schema.Value.Extensions hidden for target environment", + schemas: openapi3.Schemas{ + "schema1": { + Value: &openapi3.Schema{ + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + }, + }, + targetEnv: "prod", + expected: openapi3.Schemas{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + filter := HiddenEnvsFilter{ + metadata: &Metadata{targetEnv: tt.targetEnv}, + } + err := filter.applyOnSchemas(tt.schemas) + require.NoError(t, err) + assert.Equal(t, tt.expected, tt.schemas) + }) + } +} + func TestApply(t *testing.T) { metadata := &Metadata{ targetEnv: "prod", @@ -743,6 +1030,10 @@ func TestApply(t *testing.T) { require.NoError(t, err) assert.NotContains(t, oas.Paths.Map(), "/api/atlas/v2/groups/{groupId}/streams") assert.Contains(t, oas.Paths.Map(), "/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs") + assert.NotContains(t, oas.Components.Schemas, "test") + assert.Contains(t, oas.Components.Schemas, "testKeep") + assert.Contains(t, oas.Components.Schemas, "test2") + assert.NotContains(t, oas.Components.Schemas["test2"].Value.Properties, "testP") } func getApplyOas() *openapi3.T { @@ -772,6 +1063,39 @@ func getApplyOas() *openapi3.T { oas.Paths.Set("/api/atlas/v2/groups/{groupId}/streams", hiddenFromProd) oas.Paths.Set("/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs", hiddenFromDev) + oas.Components = &openapi3.Components{} + oas.Components.Schemas = map[string]*openapi3.SchemaRef{ + "test": { + Value: &openapi3.Schema{}, + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + "test2": { + Value: &openapi3.Schema{ + Properties: map[string]*openapi3.SchemaRef{ + "testP": { + Value: &openapi3.Schema{}, + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "prod", + }, + }, + }, + }, + }, + }, + "testKeep": { + Ref: "#/components/schemas/testKeep", + Extensions: map[string]any{ + hiddenEnvsExtension: map[string]any{ + "envs": "qa", + }, + }, + }, + } return oas } diff --git a/tools/cli/test/data/split/dev/openapi-mms.json b/tools/cli/test/data/split/dev/openapi-mms.json index 2468f39850..980fc0ef25 100644 --- a/tools/cli/test/data/split/dev/openapi-mms.json +++ b/tools/cli/test/data/split/dev/openapi-mms.json @@ -48423,6 +48423,24 @@ "ApiSearchDeploymentResponseView": { "type": "object", "properties": { + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string", + "x-xgen-hidden-env": { + "envs": "dev,qa,prod,stage" + } + }, "groupId": { "maxLength": 24, "minLength": 24, @@ -58456,10 +58474,28 @@ "title": "USS Instance Description", "required": ["providerSettings"], "type": "object", - "properties": { + "properties": { "backupSettings": { "$ref": "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string", + "x-xgen-hidden-env": { + "envs": "qa,prod,stage" + } + }, "clusterType": { "type": "string", "description": "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json b/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json index bf5feac871..64147b5e90 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json @@ -58961,6 +58961,21 @@ "backupSettings": { "$ref": "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType": { "description": "USS instance topology.", "enum": [ diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml b/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml index 6ab85d10d8..d180e6f822 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml @@ -49365,6 +49365,18 @@ components: properties: backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string clusterType: type: string description: USS instance topology. diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json b/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json index b47d1ab91b..b74ab4f765 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json @@ -48670,6 +48670,21 @@ "backupSettings" : { "$ref" : "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType" : { "type" : "string", "description" : "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml b/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml index a967553e7a..0402ac4911 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml @@ -49874,6 +49874,18 @@ components: type: object description: Group of settings that configure a MongoDB USS instance. properties: + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" clusterType: diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json b/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json index 5b24ea7aca..a9980b5602 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json @@ -49384,6 +49384,21 @@ "backupSettings" : { "$ref" : "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType" : { "type" : "string", "description" : "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml b/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml index 70f820c997..63c8ea9d01 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml @@ -50363,6 +50363,18 @@ components: type: object description: Group of settings that configure a MongoDB USS instance. properties: + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" clusterType: diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json b/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json index 81b1883f57..051a7bc4cf 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json @@ -50108,6 +50108,21 @@ "backupSettings" : { "$ref" : "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType" : { "type" : "string", "description" : "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml b/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml index dbc3faad85..829ffa9988 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml @@ -50967,6 +50967,18 @@ components: properties: backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string clusterType: type: string description: USS instance topology. diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json b/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json index c43f22b597..39151f2961 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json @@ -51376,6 +51376,21 @@ "backupSettings" : { "$ref" : "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType" : { "type" : "string", "description" : "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml b/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml index f750b29cdb..dc0d189c14 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml @@ -51932,6 +51932,18 @@ components: properties: backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string clusterType: type: string description: USS instance topology. diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json b/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json index 4e1764855e..08b42815c7 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json @@ -51364,6 +51364,21 @@ "enum" : [ "REPLICASET", "LOADBALANCED" ], "readOnly" : true }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "connectionStrings" : { "$ref" : "#/components/schemas/USSConnectionStrings20250101" }, diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml b/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml index 2f5ecc10b0..c76f7cd471 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml @@ -52039,6 +52039,18 @@ components: properties: backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string clusterType: type: string description: USS instance topology. diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json b/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json index 39f7b8a64b..e123ee3da8 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json +++ b/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json @@ -51692,6 +51692,21 @@ "enum" : [ "REPLICASET", "LOADBALANCED" ], "readOnly" : true }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "connectionStrings" : { "$ref" : "#/components/schemas/USSConnectionStrings20250101" }, diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml b/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml index 4e5e0c5080..afd76c03a9 100644 --- a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml @@ -52276,6 +52276,18 @@ components: type: object description: Group of settings that configure a MongoDB USS instance. properties: + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" clusterType: diff --git a/tools/cli/test/data/split/dev/openapi-v2.json b/tools/cli/test/data/split/dev/openapi-v2.json index 0bf1265681..10288277b1 100644 --- a/tools/cli/test/data/split/dev/openapi-v2.json +++ b/tools/cli/test/data/split/dev/openapi-v2.json @@ -52075,6 +52075,21 @@ "backupSettings" : { "$ref" : "#/components/schemas/USSBackupSettings20250101" }, + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string" + }, "clusterType" : { "type" : "string", "description" : "USS instance topology.", diff --git a/tools/cli/test/data/split/dev/openapi-v2.yaml b/tools/cli/test/data/split/dev/openapi-v2.yaml index d20a265ad9..159aaba00e 100644 --- a/tools/cli/test/data/split/dev/openapi-v2.yaml +++ b/tools/cli/test/data/split/dev/openapi-v2.yaml @@ -52534,6 +52534,18 @@ components: type: object description: Group of settings that configure a MongoDB USS instance. properties: + hiddenPropertyTest: + description: Hidden property test. + enum: + - NONE + - AWS + - AZURE + - GCP + externalDocs: + description: Test + url: https://www.mongodb.com/docs/atlas + readOnly: true + type: string backupSettings: $ref: "#/components/schemas/USSBackupSettings20250101" clusterType: diff --git a/tools/cli/test/data/split/prod/openapi-mms.json b/tools/cli/test/data/split/prod/openapi-mms.json index 39d7cfc818..97aaeb3fa9 100644 --- a/tools/cli/test/data/split/prod/openapi-mms.json +++ b/tools/cli/test/data/split/prod/openapi-mms.json @@ -48075,6 +48075,24 @@ "ApiSearchDeploymentResponseView": { "type": "object", "properties": { + "hiddenPropertyTest": { + "description": "Hidden property test.", + "enum": [ + "NONE", + "AWS", + "AZURE", + "GCP" + ], + "externalDocs": { + "description": "Test", + "url": "https://www.mongodb.com/docs/atlas" + }, + "readOnly": true, + "type": "string", + "x-xgen-hidden-env": { + "envs": "qa,prod,stage" + } + }, "groupId": { "maxLength": 24, "minLength": 24,