Skip to content
Closed
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
4 changes: 4 additions & 0 deletions generator/whitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ const whitelist: WhitelistConfig[] = [
namespace: 'Microsoft.DBforMariaDB',
},
{
basePath: 'msi/resource-manager',
Comment thread
anthony-c-martin marked this conversation as resolved.
namespace: 'Microsoft.ManagedIdentity',
},
{
basePath: 'mysql/resource-manager',
namespace: 'Microsoft.DBforMySQL',
},
Expand Down
35 changes: 18 additions & 17 deletions schemas/2015-08-31-preview/Microsoft.ManagedIdentity.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
"userAssignedIdentities": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the identity resource."
},
"type": {
"type": "string",
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
]
},
"apiVersion": {
"type": "string",
"enum": [
Expand All @@ -25,30 +15,41 @@
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
"description": "The Azure region where the resource lives."
},
"name": {
"type": "string",
"description": "The name of the identity resource."
},
"tags": {
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"properties": {}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Resource tags"
},
"type": {
"type": "string",
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
]
}
},
"required": [
"name",
"type",
"apiVersion",
"location"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is location being removed from the required properties?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I move the "required" field from the Identity definition to the Resource definition, the schema is correctly generated with location as required.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we have a PR that should address that, using Azure common types: Azure/azure-rest-api-specs#8352

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthony-c-martin can you try to regenerate? We've updated our swagger to use Azure common types definitions.

"name",
"type"
],
"description": "Microsoft.ManagedIdentity/userAssignedIdentities"
}
}
}
},
"definitions": {}
}
35 changes: 18 additions & 17 deletions schemas/2018-11-30/Microsoft.ManagedIdentity.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
"userAssignedIdentities": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the identity resource."
},
"type": {
"type": "string",
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
]
},
"apiVersion": {
"type": "string",
"enum": [
Expand All @@ -25,30 +15,41 @@
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
"description": "The Azure region where the resource lives."
},
"name": {
"type": "string",
"description": "The name of the identity resource."
},
"tags": {
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"properties": {}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Resource tags"
},
"type": {
"type": "string",
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
]
}
},
"required": [
"name",
"type",
"apiVersion",
"location"
"name",
"type"
],
"description": "Microsoft.ManagedIdentity/userAssignedIdentities"
}
}
}
},
"definitions": {}
}
2 changes: 0 additions & 2 deletions schemas/2019-04-01/deploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -1320,8 +1320,6 @@
{ "$ref": "https://schema.management.azure.com/schemas/2016-10-01/Microsoft.StorSimple.json#/resourceDefinitions/managers_storageAccountCredentials" },
{ "$ref": "https://schema.management.azure.com/schemas/2016-10-01/Microsoft.StorSimple.json#/resourceDefinitions/managers_storageDomains" },
{ "$ref": "https://schema.management.azure.com/schemas/2018-10-01/Microsoft.SignalRService.json#/resourceDefinitions/SignalR" },
{ "$ref": "https://schema.management.azure.com/schemas/2015-08-31-preview/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities" },
{ "$ref": "https://schema.management.azure.com/schemas/2018-11-30/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities" },
{ "$ref": "https://schema.management.azure.com/schemas/2015-06-01-preview/Microsoft.Security.json#/resourceDefinitions/jitNetworkAccessPolicies" },
{ "$ref": "https://schema.management.azure.com/schemas/2017-08-01-preview/Microsoft.Security.json#/resourceDefinitions/pricings" },
{ "$ref": "https://schema.management.azure.com/schemas/2017-08-01-preview/Microsoft.Security.json#/resourceDefinitions/securityContacts" },
Expand Down
6 changes: 6 additions & 0 deletions schemas/common/autogeneratedResources.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,12 @@
{
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.Maintenance.json#/resourceDefinitions/maintenanceConfigurations"
},
{
"$ref": "https://schema.management.azure.com/schemas/2015-08-31-preview/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-11-30/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01-preview/Microsoft.ManagedNetwork.json#/resourceDefinitions/managedNetworks"
},
Expand Down
15 changes: 6 additions & 9 deletions tests/2015-08-31-preview/Microsoft.ManagedIdentity.tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
"definition": "https://schema.management.azure.com/schemas/2015-08-31-preview/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities",
"expectedErrors": [
{
"message": "Missing required property: name",
"dataPath": "/"
},
{
"message": "Missing required property: type",
"message": "Missing required property: apiVersion",
"dataPath": "/"
},
{
"message": "Missing required property: apiVersion",
"message": "Missing required property: name",
"dataPath": "/"
},
{
"message": "Missing required property: location",
"message": "Missing required property: type",
"dataPath": "/"
}
}
],
"json": { }
},
Expand All @@ -30,7 +26,8 @@
"name": "id",
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
"apiVersion": "2015-08-31-preview",
"location": "West Us"
"location": "West Us",
"properties": {}
}
}
]
Expand Down
15 changes: 6 additions & 9 deletions tests/2018-11-30/Microsoft.ManagedIdentity.tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
"definition": "https://schema.management.azure.com/schemas/2018-11-30/Microsoft.ManagedIdentity.json#/resourceDefinitions/userAssignedIdentities",
"expectedErrors": [
{
"message": "Missing required property: name",
"dataPath": "/"
},
{
"message": "Missing required property: type",
"message": "Missing required property: apiVersion",
"dataPath": "/"
},
{
"message": "Missing required property: apiVersion",
"message": "Missing required property: name",
"dataPath": "/"
},
{
"message": "Missing required property: location",
"message": "Missing required property: type",
"dataPath": "/"
}
}
],
"json": { }
},
Expand All @@ -30,7 +26,8 @@
"name": "id",
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
"apiVersion": "2018-11-30",
"location": "West Us"
"location": "West Us",
"properties": {}
}
}
]
Expand Down