Skip to content

fix the empty client issue #7160

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

Merged
merged 6 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

import { UsageFlags } from "@azure-tools/typespec-client-generator-core";
import { NoTarget } from "@typespec/compiler";
import { CSharpEmitterContext } from "../sdk-context.js";
import { CodeModel } from "../type/code-model.js";
import { fromSdkClients } from "./client-converter.js";
Expand All @@ -24,14 +23,6 @@ export function createModel(sdkContext: CSharpEmitterContext): CodeModel {
const sdkApiVersionEnums = sdkPackage.enums.filter((e) => e.usage === UsageFlags.ApiVersionEnum);

const rootClients = sdkPackage.clients;
if (rootClients.length === 0) {
sdkContext.logger.reportDiagnostic({
code: "no-root-client",
format: {},
target: NoTarget,
});
return {} as CodeModel;
}

const rootApiVersions =
sdkApiVersionEnums.length > 0
Expand Down
7 changes: 0 additions & 7 deletions packages/http-client-csharp/emitter/src/lib/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ const diags: { [code: string]: DiagnosticDefinition<DiagnosticMessages> } = {
invalidVersion: paramMessage`The .NET SDK found is version ${"installedVersion"}. Please install the .NET SDK ${"dotnetMajorVersion"} or above and ensure there is no global.json in the file system requesting a lower version. Guidance for installing the .NET SDK can be found at ${"downloadUrl"}.`,
},
},
"no-root-client": {
severity: "error",
messages: {
default:
"Cannot generate CSharp SDK since no public root client is defined in typespec file.",
},
},
"unsupported-auth": {
severity: "warning",
messages: {
Expand Down
Loading