Skip to content

Commit

Permalink
[CosmosDB] Fixing bugs in Services APIs (#15971)
Browse files Browse the repository at this point in the history
* test

* try1

* fixing services discriminator

* prettier and readme

* revert additional changes

* fixing model validation errors

* model validation fix

* nit

Co-authored-by: Meha Kaushik <[email protected]>
  • Loading branch information
MehaKaushik and Meha Kaushik authored Sep 14, 2021
1 parent 39fa4ce commit 6223e02
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "sqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "SqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "SqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ServiceResource"
"$ref": "#/definitions/ServiceResourceCreateUpdateParameters"
},
"description": "The Service resource parameters."
}
Expand Down Expand Up @@ -288,6 +288,34 @@
}
}
},
"ServiceResourceCreateUpdateParameters": {
"description": "Parameters for Create or Update Request for ServiceResource",
"type": "object",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ServiceResourceCreateUpdateProperties"
}
}
},
"ServiceResourceCreateUpdateProperties": {
"description": "Properties in ServiceResourceCreateUpdateParameters.",
"type": "object",
"properties": {
"instanceSize": {
"$ref": "#/definitions/ServiceResourceInstanceSize"
},
"instanceCount": {
"description": "Instance count for the service.",
"type": "integer",
"minimum": 0,
"format": "int32"
},
"serviceType": {
"$ref": "#/definitions/ServiceType"
}
}
},
"ServiceResourceListResult": {
"properties": {
"value": {
Expand All @@ -314,6 +342,7 @@
"DataTransferServiceResourceProperties": {
"description": "Properties for DataTransferServiceResource.",
"type": "object",
"x-ms-discriminator-value": "DataTransfer",
"allOf": [
{
"$ref": "#/definitions/ServiceResourceProperties"
Expand Down Expand Up @@ -343,6 +372,7 @@
"SqlDedicatedGatewayServiceResourceProperties": {
"description": "Properties for SqlDedicatedGatewayServiceResource.",
"type": "object",
"x-ms-discriminator-value": "SqlDedicatedGateway",
"allOf": [
{
"$ref": "#/definitions/ServiceResourceProperties"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "sqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "SqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"instanceSize": "Cosmos.D4s",
"instanceCount": 1,
"serviceType": "SqlDedicatedGateway",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
"locations": [
{
"name": "SqlDedicatedGateway-westus2",
"location": "West US 2",
"status": "Running",
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
"sqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ServiceResource"
"$ref": "#/definitions/ServiceResourceCreateUpdateParameters"
},
"description": "The Service resource parameters."
}
Expand Down Expand Up @@ -285,6 +285,34 @@
"serviceType"
]
},
"ServiceResourceCreateUpdateParameters": {
"description": "Parameters for Create or Update Request for ServiceResource",
"type": "object",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ServiceResourceCreateUpdateProperties"
}
}
},
"ServiceResourceCreateUpdateProperties": {
"description": "Properties in ServiceResourceCreateUpdateParameters.",
"type": "object",
"properties": {
"instanceSize": {
"$ref": "#/definitions/ServiceResourceInstanceSize"
},
"instanceCount": {
"description": "Instance count for the service.",
"type": "integer",
"minimum": 0,
"format": "int32"
},
"serviceType": {
"$ref": "#/definitions/ServiceType"
}
}
},
"ServiceResource": {
"description": "Properties for the database account.",
"type": "object",
Expand Down Expand Up @@ -327,6 +355,7 @@
"DataTransferServiceResourceProperties": {
"description": "Properties for DataTransferServiceResource.",
"type": "object",
"x-ms-discriminator-value": "DataTransfer",
"allOf": [
{
"$ref": "#/definitions/ServiceResourceProperties"
Expand Down Expand Up @@ -356,6 +385,7 @@
"SqlDedicatedGatewayServiceResourceProperties": {
"description": "Properties for SqlDedicatedGatewayServiceResource.",
"type": "object",
"x-ms-discriminator-value": "SqlDedicatedGateway",
"allOf": [
{
"$ref": "#/definitions/ServiceResourceProperties"
Expand Down Expand Up @@ -389,6 +419,7 @@
"GraphAPIComputeServiceResourceProperties": {
"description": "Properties for GraphAPIComputeServiceResource.",
"type": "object",
"x-ms-discriminator-value": "GraphAPICompute",
"allOf": [
{
"$ref": "#/definitions/ServiceResourceProperties"
Expand Down

0 comments on commit 6223e02

Please sign in to comment.