Open lmazuel opened 1 month ago
I think the proposal makes sense. About the filename, since SDK users usually don't need care about it, we could mark it with _
to declare it is inner file so maybe _metadata.json
is better.
though tcgc should be a lib depended by language's emitter, it has the ability to emit the metadata file if needed.
@srnagar is suggesting we're merging that with the current apiview_properties.json
file, and I feel it makes sense to avoid having too much files
@srnagar is suggesting we're merging that with the current
apiview_properties.json
file, and I feel it makes sense to avoid having too much files
agree. emitter could use client.apiVersions[-1]
to get the api version. @iscai-msft do you think we need to add more explicit property in SdkClientType
to indicate the api version client generated from?
we have getDefaultApiVersion
right now, I feel that's the best way to do it. We could add a defaultApiVersion
property, but I think we're good for now
getDefaultApiVersion
need the raw typespec namespace. i don't think it is a good way to get default.
Hmm that's a very good point, yes we can go with client.apiVersions[-1]
for now / add another property, but I think we can go without adding the property for now
We want to save some metadata in a file along with the emitted code, that can be used for some automation purposes. For instance, @weshaggard would want to use it to build a mapping of package version with support api-version
Proposal
Create a file
metadata.json
that contains:This file is not generated by default, and is enabled if the flag
emit-metadata: true
is passed in the tspconfig.yaml.Each emitter will need to do that code, as TCGC should not be responsible to write files on disk. We could have though TCGC building the dict for us, with a
getMetadataInfo()
that emitters just have to put on disk. This way, this is consistent cross-language.