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

Fix common-types specification differences with azure-rest-api-specs #2250

Open
wants to merge 7 commits into
base: main
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-azure-resource-manager"
---

Addressing common type differences with common types in azure-rest-api-specs, such as ordering of elements, lower/upper case in definition names, typos, and incorrect format on the next link.
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@
"type": "object",
"description": "User assigned identity properties",
"properties": {
"clientId": {
"principalId": {
"type": "string",
"format": "uuid",
"description": "The client ID of the assigned identity.",
"description": "The principal ID of the assigned identity.",
"readOnly": true
},
"principalId": {
"clientId": {
"type": "string",
"format": "uuid",
"description": "The principal ID of the assigned identity.",
"description": "The client ID of the assigned identity.",
"readOnly": true
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/samples/common-types/openapi/v3/privatelinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"definitions": {
"PrivateEndpoint": {
"type": "object",
"description": "The Private Endpoint resource.",
"description": "The private endpoint resource.",
"properties": {
"id": {
"type": "string",
"description": "The resource identifier for private endpoint",
"description": "The resource identifier of the private endpoint",
"readOnly": true
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@
{
"name": "Pending",
"value": "Pending",
"description": "Connectionaiting for approval or rejection"
"description": "Connection waiting for approval or rejection"
},
{
"name": "Approved",
Expand Down
147 changes: 74 additions & 73 deletions packages/samples/common-types/openapi/v3/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,6 @@
}
}
},
"EncryptionProperties": {
"type": "object",
"description": "Configuration of key for data encryption",
"properties": {
"status": {
"$ref": "#/definitions/EncryptionStatus",
"description": "Indicates whether or not the encryption is enabled for container registry."
},
"keyVaultProperties": {
"$ref": "#/definitions/KeyVaultProperties",
"description": "Key vault properties."
}
}
},
"EncryptionStatus": {
"type": "string",
"description": "Indicates whether or not the encryption is enabled for container registry.",
Expand Down Expand Up @@ -244,32 +230,6 @@
}
}
},
"LocationData": {
"type": "object",
"description": "Metadata pertaining to the geographic location of the resource.",
"properties": {
"name": {
"type": "string",
"description": "A canonical name for the geographic or physical location.",
"maxLength": 256
},
"city": {
"type": "string",
"description": "The city or locality where the resource is located."
},
"district": {
"type": "string",
"description": "The district, state, or province where the resource is located."
},
"countryOrRegion": {
"type": "string",
"description": "The country or region where the resource is located"
}
},
"required": [
"name"
]
},
"LocationResourceParameter": {
"type": "object",
"description": "The default location parameter type.",
Expand Down Expand Up @@ -503,7 +463,7 @@
"readOnly": true
},
"systemData": {
"$ref": "#/definitions/SystemData",
"$ref": "#/definitions/systemData",
"description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.",
"readOnly": true
}
Expand Down Expand Up @@ -625,38 +585,6 @@
]
}
},
"SystemData": {
"type": "object",
"description": "Metadata pertaining to creation and last modification of the resource.",
"properties": {
"createdBy": {
"type": "string",
"description": "The identity that created the resource."
},
"createdByType": {
"$ref": "#/definitions/createdByType",
"description": "The type of identity that created the resource."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "The timestamp of resource creation (UTC)."
},
"lastModifiedBy": {
"type": "string",
"description": "The identity that last modified the resource."
},
"lastModifiedByType": {
"$ref": "#/definitions/createdByType",
"description": "The type of identity that last modified the resource."
},
"lastModifiedAt": {
"type": "string",
"format": "date-time",
"description": "The timestamp of resource last modification (UTC)"
}
}
},
"TrackedResource": {
"type": "object",
"description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
Expand Down Expand Up @@ -721,6 +649,78 @@
}
]
}
},
"encryptionProperties": {
"type": "object",
"description": "Configuration of key for data encryption",
"properties": {
"status": {
"$ref": "#/definitions/EncryptionStatus",
"description": "Indicates whether or not the encryption is enabled for container registry."
},
"keyVaultProperties": {
"$ref": "#/definitions/KeyVaultProperties",
"description": "Key vault properties."
}
}
},
"locationData": {
"type": "object",
"description": "Metadata pertaining to the geographic location of the resource.",
"properties": {
"name": {
"type": "string",
"description": "A canonical name for the geographic or physical location.",
"maxLength": 256
},
"city": {
"type": "string",
"description": "The city or locality where the resource is located."
},
"district": {
"type": "string",
"description": "The district, state, or province where the resource is located."
},
"countryOrRegion": {
"type": "string",
"description": "The country or region where the resource is located"
}
},
"required": [
"name"
]
},
"systemData": {
"type": "object",
"description": "Metadata pertaining to creation and last modification of the resource.",
"properties": {
"createdBy": {
"type": "string",
"description": "The identity that created the resource."
},
"createdByType": {
"$ref": "#/definitions/createdByType",
"description": "The type of identity that created the resource."
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "The timestamp of resource creation (UTC)."
},
"lastModifiedBy": {
"type": "string",
"description": "The identity that last modified the resource."
},
"lastModifiedByType": {
"$ref": "#/definitions/createdByType",
"description": "The type of identity that last modified the resource."
},
"lastModifiedAt": {
"type": "string",
"format": "date-time",
"description": "The timestamp of resource last modification (UTC)"
}
}
}
},
"parameters": {
Expand Down Expand Up @@ -769,6 +769,7 @@
"description": "The ID of the target subscription. The value must be an UUID.",
"required": true,
"type": "string",
"minLength": 1,
"x-ms-parameter-location": "client"
}
}
Expand Down
56 changes: 28 additions & 28 deletions packages/samples/common-types/openapi/v4/customermanagedkeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,6 @@
},
"paths": {},
"definitions": {
"CustomerManagedKeyEncryption": {
"type": "object",
"description": "Customer-managed key encryption properties for the resource.",
"properties": {
"keyEncryptionKeyIdentity": {
"$ref": "#/definitions/KeyEncryptionKeyIdentity",
"description": "All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault."
},
"keyEncryptionKeyUrl": {
"type": "string",
"description": "key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek."
}
}
},
"Encryption": {
"type": "object",
"description": "(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.",
"properties": {
"infrastructureEncryption": {
"$ref": "#/definitions/InfrastructureEncryption",
"description": "Values are enabled and disabled."
},
"customerManagedKeyEncryption": {
"$ref": "#/definitions/CustomerManagedKeyEncryption",
"description": "All Customer-managed key encryption properties for the resource."
}
}
},
"InfrastructureEncryption": {
"type": "string",
"description": "(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.",
Expand Down Expand Up @@ -107,6 +79,34 @@
}
]
}
},
"customerManagedKeyEncryption": {
"type": "object",
"description": "Customer-managed key encryption properties for the resource.",
"properties": {
"keyEncryptionKeyIdentity": {
"$ref": "#/definitions/KeyEncryptionKeyIdentity",
"description": "All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault."
},
"keyEncryptionKeyUrl": {
"type": "string",
"description": "key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek."
}
}
},
"encryption": {
"type": "object",
"description": "(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.",
"properties": {
"infrastructureEncryption": {
"$ref": "#/definitions/InfrastructureEncryption",
"description": "Values are enabled and disabled."
},
"customerManagedKeyEncryption": {
"$ref": "#/definitions/customerManagedKeyEncryption",
"description": "All Customer-managed key encryption properties for the resource."
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@
"type": "object",
"description": "User assigned identity properties",
"properties": {
"clientId": {
"principalId": {
"type": "string",
"format": "uuid",
"description": "The client ID of the assigned identity.",
"description": "The principal ID of the assigned identity.",
"readOnly": true
},
"principalId": {
"clientId": {
"type": "string",
"format": "uuid",
"description": "The principal ID of the assigned identity.",
"description": "The client ID of the assigned identity.",
"readOnly": true
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/samples/common-types/openapi/v4/privatelinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"definitions": {
"PrivateEndpoint": {
"type": "object",
"description": "The Private Endpoint resource.",
"description": "The private endpoint resource.",
"properties": {
"id": {
"type": "string",
"format": "arm-id",
"description": "The resource identifier for private endpoint",
"description": "The resource identifier of the private endpoint",
"readOnly": true
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@
{
"name": "Pending",
"value": "Pending",
"description": "Connectionaiting for approval or rejection"
"description": "Connection waiting for approval or rejection"
},
{
"name": "Approved",
Expand Down
Loading
Loading