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

Refine the client-namespace-conflict diagnostic #6161

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove the diagnostic, will add it into csharp side later
  • Loading branch information
ArcturusZhang committed Feb 26, 2025
commit 07c774fb88d5398e598cec590f13194736f2598e
Original file line number Diff line number Diff line change
@@ -92,19 +92,6 @@ export function createModel(sdkContext: CSharpEmitterContext): CodeModel {
const uri = getMethodUri(endpointParameter);
const clientParameters = fromSdkEndpointParameter(endpointParameter);
const clientName = getClientName(client, parentNames);
// see if this namespace is a sub-namespace of an existing bad namespace
const segments = client.namespace.split(".");
const lastSegment = segments[segments.length - 1];
if (lastSegment === clientName) {
// we report diagnostics when the last segment of the namespace is the same as the client name
// because in our design, a sub namespace will be generated as a sub client with exact the same name as the namespace
// in csharp, this will cause a conflict between the namespace and the class name
sdkContext.logger.reportDiagnostic({
code: "client-namespace-conflict",
format: { namespace: client.namespace, clientName },
target: client.__raw.type ?? NoTarget,
});
}

return {
Name: clientName,
Loading
Oops, something went wrong.