Skip to content

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

Open
@ArcturusZhang

Description

@ArcturusZhang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharp

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions