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

[http-client-csharp] no longer pass through fallback values for configurations #5897

Open
ArcturusZhang opened this issue Feb 7, 2025 · 0 comments
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@ArcturusZhang
Copy link
Member

In our emitter, we have some quite complicated logic when a certain configuration is missing, for instance, we have:

const namespace = options.namespace ?? root.Name;

which takes the namespace from the options (if any), if no, we use the namespace defined in the typespec file as namespace.
Same thing happens to library-name, we are doing it in this way:

const libraryName = options["library-name"] ?? options.namespace ?? root.Name;

This could be cumbersome especially in the context that we are going to remove the configuration namespace (tracking here)

To keep the logic simple, the emitter should just parse whatever in the input, and then pass them through and let the following C# generator to determine which value to fallback when one configuration is missing.

@ArcturusZhang ArcturusZhang added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

1 participant