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

[Bug][TCGC]: @server description is used as endpoint parameter description #1212

Closed
4 tasks done
Tracked by #3994
archerzz opened this issue Jul 22, 2024 · 4 comments · Fixed by #1233
Closed
4 tasks done
Tracked by #3994

[Bug][TCGC]: @server description is used as endpoint parameter description #1212

archerzz opened this issue Jul 22, 2024 · 4 comments · Fixed by #1233
Assignees
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@archerzz
Copy link
Member

Describe the bug

See this spec: https://github.com/Azure/azure-rest-api-specs/blob/2e5be0e72597c6fc8d438f20e38087d900c16427/specification/confidentialledger/Microsoft.CodeTransparency/main.tsp#L19-L25

@server(
  "{endpoint}",
  "Code Transparency Service",
  {
    endpoint: url,
  }
)

In TCGC, the description of parameter endpoint is Code Transparency Service, which is wrong. If @doc is not defined, the description should be empty.

Reproduction

Just parse the spec in the link above.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@archerzz archerzz added bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library labels Jul 22, 2024
@iscai-msft
Copy link
Contributor

The original point for this was to make sure the description for a server still gets generated, since it is a required parameter, I understand the concern though. Do you have any suggestions? I think it is important to still generate the docs somewhere, since we required users to input them.

@tadelesh
Copy link
Member

it is weird to use service doc as endpoint param doc. is it possible to put the doc in the client if not provided?

@archerzz
Copy link
Member Author

archerzz commented Jul 24, 2024

The original point for this was to make sure the description for a server still gets generated, since it is a required parameter, I understand the concern though. Do you have any suggestions? I think it is important to still generate the docs somewhere, since we required users to input them.

I suggest we just leave it empty if @doc is not defined. Let each language team to decide what they want to generate by default.

Here is another example: https://github.com/Azure/azure-rest-api-specs/blob/aa23ddc02b2b1c5a34c56a49d83b77c0a1aaa614/specification/purview/Azure.Analytics.Purview.DataMap/main.tsp#L12-L18

That will generate an endpoint parameter with a very long description which looks weird.

@iscai-msft
Copy link
Contributor

Let me ask for suggestions in the TypeSpec channel. I'm not sure adding it to the end of client is the best either: in the example @archerzz gave, they just duplicated the documentation for the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants