-
Notifications
You must be signed in to change notification settings - Fork 41
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
Every SdkType
should have a name
and namespace
#877
Comments
@iscai-msft this namespace is not client namespace, it is the typespec original namespace which will be used to identify the source of the model to do model replacement. for e.g., |
I still don't get why it's needed, since we filter out core models. Can you give more of an example of how the namespaces would be different and what the usage would be? Thanks! In terms of |
For example, when some one writes this:
to get a tracked resource model with an When we get the model from TCGC, we need to know the type name and namespace To summary, we want the namespace on models and enums (and potentially every other types) because we want to identify which typespec file these type come from so that in the generator of SDKs, we could know if a type should be generated into files as part of the library we are currently generating, or this type should be generated as an existing type from a core library (in this case, no file will be generated for it) For the requirement on name, it is not something we would use, just for completeness of the system, because logically, every type should have a name, for example, the name of built-in type string is just string, and this is how we call it. |
Another example of "we need namespace" for types is this: https://azure.github.io/typespec-azure/docs/libraries/azure-core/reference/data-types#Azure.Core.EmbeddingVector |
In RLC, we have similar logic to trace the namespace all the way to the top to determine if this type is from Azure.Core. |
…e` and `SdkUnionType` (Azure#1009) Fixes Azure#877
The downstream SDK might not use this information, but semantically speaking, every type should have a name and namespace.
For example, the
name
of string type could just bestring
, and its namespace could be something likeTypeSpec.Internal
orTypeSpec.Foundations
whatever defined in the typespec type system.The text was updated successfully, but these errors were encountered: