Skip to content
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
6b95d61
after being converted
welovej Apr 21, 2025
01bcdad
tsp optimized and compiled into swagger
welovej Apr 21, 2025
2c25232
removed too early tsp rename and type fix
welovej Apr 21, 2025
9c99306
Update readme.md
welovej Apr 22, 2025
faff190
fix page
welovej Apr 22, 2025
ffd9fcb
Update tspconfig.yaml
welovej Apr 23, 2025
c6c613e
Update tspconfig.yaml
welovej Apr 23, 2025
0b3b4b1
update
welovej Apr 28, 2025
5f0c8bc
update
welovej Apr 28, 2025
bca8a34
update
welovej Apr 28, 2025
58eadfb
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
May 8, 2025
4689c6b
Update tspconfig.yaml
welovej May 8, 2025
fc3d499
Merge branch 'TspMig-healthbot' of https://github.com/welovej/azure-r…
welovej May 8, 2025
aa594d3
Update specification/healthbot/Healthbot.Management/tspconfig.yaml
MaryGao May 8, 2025
e3e5273
Update specification/healthbot/Healthbot.Management/tspconfig.yaml
MaryGao May 8, 2025
ffe66f4
prettier
welovej May 9, 2025
f5ef155
Update tspconfig.yaml
welovej May 9, 2025
a5baf3e
prettier exmaples
welovej May 9, 2025
dd3f5c6
Delete diff.json
welovej May 9, 2025
8af8366
Update models.tsp
welovej May 9, 2025
40d39ee
Update tspconfig.yaml
welovej May 9, 2025
5fb60d8
Update back-compatible.tsp
welovej May 9, 2025
71a0725
Update main.tsp
welovej May 9, 2025
5aa2e58
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
May 10, 2025
677cc0b
update
May 10, 2025
6e73755
Merge branch 'TspMig-healthbot' of https://github.com/welovej/azure-r…
welovej May 12, 2025
ba12d1e
Update healthbot.json
welovej May 12, 2025
c2cfb43
Merge branch 'main' into TspMig-healthbot
JiaqiZhang-Dev May 14, 2025
3a685f3
Merge branch 'main' into TspMig-healthbot
v-jiaodi May 29, 2025
8d7ad7a
resolve breaking change
v-jiaodi Jun 5, 2025
118ee38
Merge branch 'main' into TspMig-healthbot
v-jiaodi Jun 10, 2025
a9c6b51
resolve breaking change with client.tsp
v-jiaodi Jun 10, 2025
5ee40d3
FIXME update
welovej Jun 23, 2025
7f8de9e
Merge remote-tracking branch 'upstream/main' into TspMig-healthbot
welovej Jun 27, 2025
42d1779
example files
welovej Jun 27, 2025
8dcc1a4
update
welovej Jun 27, 2025
aa18b1c
recoery of previous api version
welovej Jun 27, 2025
8b9ac71
fix for model validation
welovej Jul 1, 2025
2de5a76
Merge branch 'main' into TspMig-healthbot
v-jiaodi Jul 7, 2025
adb6660
Merge branch 'main' into TspMig-healthbot
v-jiaodi Jul 8, 2025
18fedd3
Update specification/healthbot/Healthbot.Management/tspconfig.yaml
weidongxu-microsoft Jul 9, 2025
8457045
Update specification/healthbot/Healthbot.Management/tspconfig.yaml
weidongxu-microsoft Jul 9, 2025
7b35532
update
Jul 9, 2025
bed39bb
Merge branch 'TspMig-healthbot' of https://github.com/welovej/azure-r…
Jul 9, 2025
b89d23e
update ErrorError
welovej Jul 10, 2025
47d88dd
Merge branch 'main' into TspMig-healthbot
v-jiaodi Jul 11, 2025
5bb5ad9
prettier
welovej Jul 14, 2025
26a819b
update
Jul 18, 2025
fc5251d
remove csharp emmiter
welovej Jul 23, 2025
317fc2e
Rename Healthbot.Management to HealthBot.Management
welovej Jul 24, 2025
ab7b671
fix for comment
welovej Jul 30, 2025
8c48db5
remove private things
welovej Jul 30, 2025
54484bf
fix final-stat-via
welovej Jul 31, 2025
22c7979
Merge branch 'main' into TspMig-healthbot
welovej Aug 5, 2025
f14c85b
update
welovej Aug 26, 2025
f80ff8a
update new config for golang
welovej Sep 19, 2025
78702c7
Update main.tsp
welovej Sep 19, 2025
2db438e
rename ErrorError to ErrorDetail
welovej Sep 22, 2025
098e942
Update client.tsp
welovej Sep 23, 2025
8c950ea
update
welovej Sep 23, 2025
472f517
Merge branch 'main' into TspMig-healthbot
pshao25 Oct 29, 2025
6fc786c
Remove unused dependency annotations from Versions enum
welovej Oct 29, 2025
27c1578
Update emitter output directories in tspconfig.yaml
welovej Oct 29, 2025
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
131 changes: 131 additions & 0 deletions specification/healthbot/HealthBot.Management/HealthBot.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.HealthBot;
/**
* Azure Health Bot resource definition
*/
model HealthBot
is Azure.ResourceManager.TrackedResource<HealthBotProperties, true> {
...ResourceNameParameter<
Resource = HealthBot,
KeyName = "botName",
SegmentName = "healthBots",
NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
>;

/**
* SKU of the Azure Health Bot.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we know why this warning is popping up? Can we design this differently?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The envelop property in our library is

@doc("The SKU (Stock Keeping Unit) assigned to this resource.")
model ResourceSkuProperty {
  @doc("The SKU (Stock Keeping Unit) assigned to this resource.")
  sku?: Sku;
}

However, in the original swagger, the sku is required so that we cannot use the envelop one.

Can we design this differently?

Sounds a question to @markcowl

sku: Sku;

/**
* The identity of the Azure Health Bot.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
identity?: Identity;
}

@armResourceOperations
interface HealthBots {
/**
* Get a HealthBot.
*/
get is ArmResourceRead<HealthBot, Error = Error>;

/**
* Create a new Azure Health Bot.
*/
create is ArmResourceCreateOrReplaceAsync<
HealthBot,
Error = Error,
Response = ArmResourceUpdatedResponse<HealthBot> | ArmResourceCreatedResponse<
HealthBot,
ArmAsyncOperationHeader & Azure.Core.Foundations.RetryAfterHeader
>
>;

/**
* Patch a HealthBot.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchAsync<
HealthBot,
PatchModel = HealthBotUpdateParameters,
Error = Error,
Response = ArmResponse<HealthBot> | ArmResourceCreatedResponse<
HealthBot,
ArmLroLocationHeader<FinalResult = HealthBot> &
Azure.Core.Foundations.RetryAfterHeader
>
>;

/**
* Delete a HealthBot.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like we could have put a better justification here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is Laurant gave me in wave 1.

delete is ArmResourceDeleteWithoutOkAsync<
HealthBot,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse<LroHeaders = ArmLroLocationHeader> | ArmDeletedNoContentResponse,
Error = Error
>;

/**
* Returns all the resources of a particular type belonging to a resource group
*/
listByResourceGroup is ArmResourceListByParent<
HealthBot,
Response = ArmResponse<BotResponseList>,
Error = Error
>;

/**
* Returns all the resources of a particular type belonging to a subscription.
*/
list is ArmListBySubscription<
HealthBot,
Response = ArmResponse<BotResponseList>,
Error = Error
>;

/**
* List all secrets of a HealthBot.
*/
listSecrets is ArmResourceActionSync<
HealthBot,
void,
ArmResponse<HealthBotKeysResponse>,
Error = Error
>;

/**
* Regenerate the API JWT Secret of a HealthBot.
*/
regenerateApiJwtSecret is ArmResourceActionSync<
HealthBot,
void,
ArmResponse<HealthBotKey>,
Error = Error
>;
}

@@maxLength(HealthBot.name, 64);
@@minLength(HealthBot.name, 2);
@@doc(HealthBot.name, "The name of the Bot resource.");
@@doc(HealthBot.properties,
"The set of properties specific to Azure Health Bot resource."
);
@@doc(HealthBots.create::parameters.resource,
"The parameters to provide for the created Azure Health Bot."
);
@@doc(HealthBots.update::parameters.properties,
"The parameters to provide for the required Azure Health Bot."
);
22 changes: 22 additions & 0 deletions specification/healthbot/HealthBot.Management/back-compatible.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using Microsoft.HealthBot;

@@clientLocation(HealthBots.get, "Bots");
@@clientLocation(HealthBots.create, "Bots");
@@clientLocation(HealthBots.update, "Bots");
@@clientLocation(HealthBots.delete, "Bots");
@@clientLocation(HealthBots.listByResourceGroup, "Bots");
@@clientLocation(HealthBots.list, "Bots");
@@clientLocation(HealthBots.listSecrets, "Bots");
@@clientLocation(HealthBots.regenerateApiJwtSecret, "Bots");

@@clientName(HealthBots.create::parameters.resource, "parameters");
@@clientName(HealthBots.update::parameters.properties, "parameters");
@@visibility(BotResponseList.value, Lifecycle.Read);
@@clientName(KeyVaultProperties.keyName, "KeyName");
@@clientName(KeyVaultProperties.keyVersion, "KeyVersion");
@@clientName(KeyVaultProperties.keyVaultUri, "KeyVaultUri");
@@clientName(KeyVaultProperties.userIdentity, "UserIdentity");
@@clientName(HealthBotKeysResponse, "HealthBotKeysResult", "csharp");
5 changes: 5 additions & 0 deletions specification/healthbot/HealthBot.Management/client.tsp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are there client customizations in both this file and the back-compatible.tsp file? Should we just use one file to simplify?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here is our guidance: https://azure.github.io/typespec-azure/docs/migrate-swagger/checklists/migrate-arm-tips/

✅ DO add customizations that impact only generated client SDKs in client.tsp

✅ DO add customizations that impact both generated client SDKs and generated OpenAPI specs in back-compat.tsp

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "@azure-tools/typespec-client-generator-core";
import "./main.tsp";
using Azure.ClientGenerator.Core;

@@clientName(Microsoft.HealthBot, "HealthbotClient", "javascript");
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"api-version": "2025-05-25"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Microsoft.Healthbot/healthbots/read",
"display": {
"description": "Read Azure Health Bot",
"operation": "Read Azure Health Bot",
"provider": "Azure Health Bot",
"resource": "Azure Health Bot"
},
"origin": "user,system"
},
{
"name": "Microsoft.Healthbot/healthbots/write",
"display": {
"description": "Writes Azure Health Bot",
"operation": "Write Azure Health Bot",
"provider": "Azure Health Bot",
"resource": "Azure Health Bot"
},
"origin": "user,system"
},
{
"name": "Microsoft.Healthbot/healthbots/delete",
"display": {
"description": "Deletes Azure Health Bot",
"operation": "Delete Azure Health Bot",
"provider": "Azure Health Bot",
"resource": "Azure Health Bot"
},
"origin": "user,system"
}
]
}
}
},
"operationId": "Operations_List",
"title": "Get Operations"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"parameters": {
"api-version": "2025-05-25",
"resourceGroupName": "OneResourceGroupName",
"subscriptionId": "subscription-id"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "samplebotname",
"type": "Microsoft.HealthBot/healthBots",
"id": "/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname",
"location": "East US",
"properties": {
"botManagementPortalLink": "https://us.healthbot.microsoft.com/account/samplebotname-1yhd91k"
},
"sku": {
"name": "F0"
},
"systemData": {
"createdAt": "2020-05-05T17:18:19.1234567Z",
"createdBy": "jack@outlook.com",
"createdByType": "User",
"lastModifiedAt": "2020-05-06T17:18:19.1234567Z",
"lastModifiedBy": "ryan@outlook.com",
"lastModifiedByType": "User"
}
},
{
"name": "samplebotname2",
"type": "Microsoft.HealthBot/healthBots",
"id": "/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname2",
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "principalId",
"tenantId": "tenantId",
"userAssignedIdentities": {
"/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": {},
"/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": {}
}
},
"location": "East US",
"properties": {
"botManagementPortalLink": "https://us.healthbot.microsoft.com/account/samplebotname2-hdi1osc"
},
"sku": {
"name": "S1"
},
"systemData": {
"createdAt": "2020-05-05T17:18:19.1234567Z",
"createdBy": "jack@outlook.com",
"createdByType": "User",
"lastModifiedAt": "2020-05-06T17:18:19.1234567Z",
"lastModifiedBy": "ryan@outlook.com",
"lastModifiedByType": "User"
}
}
]
}
}
},
"operationId": "Bots_ListByResourceGroup",
"title": "List Bots by Resource Group"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parameters": {
"api-version": "2025-05-25",
"resourceGroupName": "OneResourceGroupName",
"subscriptionId": "subscription-id"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "samplebotname2",
"type": "Microsoft.HealthBot/healthBots",
"id": "/subscriptions/subscription-id/resourceGroups/OneResourceGroupName/providers/Microsoft.HealthBot/healthBots/samplebotname2",
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "principalId",
"tenantId": "tenantId",
"userAssignedIdentities": {
"/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi": {},
"/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2": {}
}
},
"location": "East US",
"properties": {
"botManagementPortalLink": "https://us.healthbot.microsoft.com/account/samplebotname2-hdi1osc"
},
"sku": {
"name": "S1"
},
"systemData": {
"createdAt": "2020-05-05T17:18:19.1234567Z",
"createdBy": "jack@outlook.com",
"createdByType": "User",
"lastModifiedAt": "2020-05-06T17:18:19.1234567Z",
"lastModifiedBy": "ryan@outlook.com",
"lastModifiedByType": "User"
}
}
]
}
}
},
"operationId": "Bots_List",
"title": "List Bots by Subscription"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"parameters": {
"api-version": "2025-05-25",
"botName": "samplebotname",
"resourceGroupName": "healthbotClient",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"secrets": [
{
"keyName": "APP_SECRET",
"value": "XXXXX"
},
{
"keyName": "WEBCHAT_SECRET",
"value": "XXXXX"
},
{
"keyName": "API_JWT_SECRET",
"value": "XXXXX"
}
]
}
}
},
"operationId": "Bots_ListSecrets",
"title": "Bot List Secrets"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parameters": {
"api-version": "2025-05-25",
"botName": "samplebotname",
"resourceGroupName": "healthbotClient",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"keyName": "API_JWT_SECRET",
"value": "XXXXX"
}
}
},
"operationId": "Bots_RegenerateApiJwtSecret",
"title": "Bot Regenerate API JWT Secret"
}
Loading
Loading