Skip to content

Commit

Permalink
remove the diagnostic, will add it into csharp side later
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcturusZhang committed Feb 26, 2025
1 parent c6ae78e commit 694d17a
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -92,23 +92,10 @@ 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.clientNamespace.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: { clientNamespace: client.clientNamespace, clientName },
target: client.__raw.type ?? NoTarget,
});
}

return {
Name: clientName,
ClientNamespace: client.clientNamespace,
Namespace: client.namespace,
Summary: client.summary,
Doc: client.doc,
Operations: client.methods
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import { Protocols } from "./protocols.js";

export interface InputClient {
Name: string;
ClientNamespace: string;
Namespace: string;
Summary?: string;
Doc?: string;
Operations: InputOperation[];

0 comments on commit 694d17a

Please sign in to comment.