-
Notifications
You must be signed in to change notification settings - Fork 32
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
specs, clientNamespace #775
base: main
Are you sure you want to change the base?
specs, clientNamespace #775
Conversation
|
ed1fefd
to
fe20868
Compare
name: "ClientNamespaceFirstClient", | ||
service: _Specs_.Azure.ClientGenerator.Core.ClientNamespace, | ||
}) | ||
@clientNamespace("azure.clientgenerator.core.clientnamespace", "java") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume for other languages:
csharp: Azure.ClientGenerator.Core.ClientNamespace
python: azure.client_generator.core.client_namespace
Let me know what the pattern for Go/JS. I will fill in here before PR public for review.
packages/cadl-ranch-specs/http/azure/client-generator-core/client-namespace/client.tsp
Outdated
Show resolved
Hide resolved
op get(): Model.SecondClientResult; | ||
|
||
namespace Model { | ||
model SecondClientResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a little weird to put model into another namespace different with client on purpose. For python SDK, we will always put model into folder models
, then current cadl-ranch will results in namespace xxx.model.models
in python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java is same logic, it would be in model.models
in azure flavor, if written like this (for unbranded, we won't automatically add that .models
).
However, there is nothing prohibit unbranded from doing this?
And the ask from OpenAI is to move some models to another SDK namespace? (I am not sure whether client goes with the models)
From current openai unbranded typespec, I didn't find a different namespace. Will double check with Srikanta on the exact use case they asks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: in client.tsp, I actually map this to same client namespace of the client.
On the other hand, I actually map the SecondClientEnumType
to a sub namespace. <-- this could be the concern for you
@@clientNamespace(Second.Model, "azure.clientgenerator.core.clientnamespace.second", "java");
@@clientNamespace(Second.Model.SecondClientEnumType, "azure.clientgenerator.core.clientnamespace.second.sub", "java");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The possible scenario of model/client in difference space (described by Srikanta) is that there be 2 catalogs of models
- model shared to multiple clients
- model only used in a single client
If we put clients to different namespaces, there will certainly case for "shared model", some of them would have different namespace from the client that uses them.
…ent-namespace/client.tsp Co-authored-by: Yuchao Yan <[email protected]>
fix #758
This scenario mainly test the case when
@clientNamespace
applied to TypeSpec Namespace/Interface/Model/Enum.So far it does not test corner cases, like client/subclient in different namespace, name conflict for model in different namespace, etc.
Cadl Ranch Contribution Checklist:
@scenario
names. Someone can look at the list of scenarios and understand what I'm covering.@scenarioDoc
s for extra scenario description and to tell people how to pass my mock api check.