Skip to content

Instantly share code, notes, and snippets.

@weidongxu-microsoft
Last active January 20, 2026 08:31
Show Gist options
  • Select an option

  • Save weidongxu-microsoft/3b9cbdfa84aeba08de4a8aad82aca78d to your computer and use it in GitHub Desktop.

Select an option

Save weidongxu-microsoft/3b9cbdfa84aeba08de4a8aad82aca78d to your computer and use it in GitHub Desktop.
Validate TypeSpec migration without SDK

This process is for SDK validation on migration that does not have existing Java SDK

Typical reason is that the tspconfig.yaml in PR configures a new Java SDK. Hence we cannot compare it with existing SDK (neither apiview nor changelog).

We had to create the apiview revision that 1. before the migration; 2. after the migration, and compare them.

For the PR that contains single Swagger JSON

  1. create a folder in SDK repo, e.g. sdk/alertsmanagement/azure-resourcemanager-alertprocessingrules
  2. in this folder, run autorest, target azure-rest-api-specs main branch autorest --use=@autorest/java@latest --java --java.output-folder=. --fluent=lite --java.fluent=lite --java.license-header=MICROSOFT_MIT_SMALL --modelerfour.lenient-model-deduplication --input-file=/c/github/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertProcessingRules/stable/2021-08-08/AlertProcessingRules.json
  3. run mvn source:jar
  4. commit the new code (commit is not important, but it gives you a chance to roll back, if there is something wrong in later steps)
  5. create a new apiview, upload the jar in target folder
  6. run autorest again (same command), target azure-rest-api-specs PR branch
  7. run mvn source:jar
  8. commit the code change
  9. in the apiview created in step 5, "add revision", upload the jar from same place (now updated), use any "label" Screenshot 2026-01-20 160519
  10. in apiview, check the diff (compare the latest revision, with the previous revision in step 5) image
  11. If nothing major, mark the migration as green

Example apiview https://spa.apiview.dev/review/7d97d70fc4fd49a081e0ebbd647fce1f?activeApiRevisionId=ba4dee3b635e4c6f9c4da65030ece82a&diffApiRevisionId=6ed94c83a4f340d3bad3fbb360663c46&diffStyle=trees image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment