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

feat(tcgc): use @server description for default endpoint client parameter #1007

Closed
4 tasks done
Tracked by #3994
archerzz opened this issue Jun 13, 2024 · 3 comments
Closed
4 tasks done
Tracked by #3994
Labels
feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@archerzz
Copy link
Member

Clear and concise description of the problem

This is a minor issue.

See cadl-ranch server definition: https://github.com/Azure/cadl-ranch/blob/2fb006d5b4609647138382bf5d248a2edbde7742/packages/cadl-ranch-expect/src/decorators.ts#L241
There is no parameter defined for endpoint, instead it's a hard-coded value.

context.call($server, target, "http://localhost:3000", "TestServer endpoint");

TCGC will give a default endpoint parameter with description Service host. Maybe we should use the description defined in @server? e.g. for this case, it's TestServer endpoint.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@archerzz archerzz added feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library labels Jun 13, 2024
@archerzz
Copy link
Member Author

archerzz commented Jul 1, 2024

Maybe we should differentiate a constant endpoint URL case from an expression endpoint URL case. For endpoint which is an expression, it would be better that each template argument description is undefined? (it doesn't make sense to assign service description to them)

@server(
    "{firstTestTypeSpecUrl}",
    "Endpoint Service",
    {
        firstTestTypeSpecUrl: string,
    }
)

@archerzz
Copy link
Member Author

archerzz commented Jul 1, 2024

Another example of why we might need to leave uri template parameter as-is:
image

@archerzz
Copy link
Member Author

We have further discussion, and we thought it might be better to just leave description empty if it's not defined. And let each language emitter to decide what they want to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

1 participant