Skip to content
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

azure-http-specs, add clientNamespace #1929

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Nov 29, 2024

fix Azure/cadl-ranch#758
move from Azure/cadl-ranch#775

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.

Current cases include

  1. clients in different clientNamespace
  2. client and model in different clientNamespace
  3. model and the model of its property in different clientNamespace

@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 29, 2024

All changed packages have been documented.

  • @azure-tools/azure-http-specs
Show changes

@azure-tools/azure-http-specs - feature ✏️

Add test scenario for clientNamespace

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

name: "ClientNamespaceFirstClient",
service: Client.ClientNamespace,
})
@clientNamespace("client.clientnamespace", "java")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to remove the scope? i believe every language needs to test ns customization.

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every language would need to use slight different SDK namespace. E.g. csharp would use maybe Client.ClientNamespace.

And for Azure, .NET maybe Azure.###, and Java be com.azure.###. They are very different.

So I think whenever we had @clientNamespace, it would be one line for one language. I expect other language fill this line, when they are implementing the clientNamespace feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msyyc could you help to add python part?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated for python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespace refactoring Scenario tests
4 participants