Azure / Azure/azure-sdk-tools

[tsp-client] more specific error message when missing commit in URL

Open
#9,260 0 comments 0 reactions 1 assignee Claimed by @catalinaperalta View on GitHub
TypeSpec
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

Right now, if you forget to put the commit in the URL when using `tsp-client init - c ` it gives the following error message:

`Error: Invalid tspconfig.yaml url:
https://github.com/Azure/azure-rest-api-specs/blob//specification/keyvault/data-plane/Security.KeyVault.Secrets/tspconfig.yaml`

The correct URL is `https://github.com/Azure/azure-rest-api-specs/blob//specification/keyvault/data-plane/Security.KeyVault.Secrets/tspconfig.yaml`

It would be really nice if the error message was more specific and explicitly stated that the URL was missing the commit. It hard to debug the issue based solely off "invalid tspconfig.yaml url".

Also, would be nice to update the documentation to state that the URL needs the commit. In the docs, the example (highlighted below) includes the commit, but it's easy to miss. I would love it if this information was explicitly written into the docs somewhere

![Image](https://github.com/user-attachments/assets/83365779-d585-451e-9684-1b46463981ce)

[tsp-client doc](https://azure.github.io/typespec-azure/docs/howtos/Generating%20with%20tsp-client/tsp_client#init)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.