microsoft / microsoft/typespec

[http-client-csharp] `WriteAdditionalFiles` is not providing something downstream generators could filter

Open
#10,279 0 comments 0 reactions 0 assignees View on GitHub
emitter:client:csharp
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

We introduced a `WriteAdditionalFiles` API, and it is implemented to write `ConfigurationSchema.json`: https://github.com/microsoft/typespec/blob/c84f7564f66f5c620708a0322f1b062521015865/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs#L55

but this extension point is an action instead of providing data - therefore for downstream generators, there are only two options: take all or reject all.
There is no such an option that a downstream generator could accept a subset in it.

Can we change this API to something like `BuildAdditionalFiles` which returns `FileInfo[]` where `FileInfo` is something like `{ filename: "", content: "" }` so that downstream generators could filter them by filenames, even modify their content.

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.