You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we start implementing "namespace is namespace" in our language emitters, TCGC plays an important role in helping emitters get the information they need to generate. At the same time, it is important that we are not breaking, both for ease of migration, and also because some languages (like javascript) don't really have a concept of "namespace" and won't be adopting this behavior the same way the other language emitters are.
As such, I propose a multi-part approach in getting TCGC to help with the "namespace is namespace" push.
Ensure that the existing .namespace string on SdkClientTypes returns the correct namespace
Add a .namespace string onto SdkModelType and SdkEnumType, so we can generate these models in the correct space.
Add additional helper method getNamespaceToClients(sdkContext) that returns a mapping of namespaces to clients in those namespaces.
Add additional helper method getNamespaceToModels(sdkContext) that will return a mapping of namespaces to models in those namespaces
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
Another option is making SkdPackage to be hierarchy with namespace, and add a flag like flatten-namespace and default to true to prevent breaking change for some languages.
How about the namespace defined in @client? As following, the client include more parts separated by ., and all the parts except the latest one will be the namespace of the client, will tcgc help to merge this to namespace of the client?
For 3 & 4, what's the user scenario? There are basically 2 ways to provide the relationship between the namespaces and their belonging entities (clients, models, etc):
a hierarchy of SdkInputNameSpace with child properties representing clients, models, etc.
Clear and concise description of the problem
As we start implementing "namespace is namespace" in our language emitters, TCGC plays an important role in helping emitters get the information they need to generate. At the same time, it is important that we are not breaking, both for ease of migration, and also because some languages (like javascript) don't really have a concept of "namespace" and won't be adopting this behavior the same way the other language emitters are.
As such, I propose a multi-part approach in getting TCGC to help with the "namespace is namespace" push.
.namespace
string onSdkClientType
s returns the correct namespace.namespace
string ontoSdkModelType
andSdkEnumType
, so we can generate these models in the correct space.getNamespaceToClients(sdkContext)
that returns a mapping of namespaces to clients in those namespaces.getNamespaceToModels(sdkContext)
that will return a mapping of namespaces to models in those namespacesChecklist
The text was updated successfully, but these errors were encountered: