Skip to content

Commit b7d7288

Browse files
authored
tsp - Use 'powershell' for @clientname decorator (#1519)
1 parent cdc2c65 commit b7d7288

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

packages/typespec-powershell/src/convertor/convertor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function resolveOperationId(psContext: SdkContext, op: HttpOperation): string {
196196
}
197197

198198
function getClientName(context: SdkContext, type: Type & { name: string }) {
199-
const clientName = getClientNameOverride(context, type);
199+
const clientName = getClientNameOverride(context, type, "powershell");
200200
return clientName ?? type.name;
201201
}
202202

packages/typespec-powershell/src/utils/modelUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ function getSchemaForModel(
743743
}
744744

745745
const program = dpgContext.program;
746-
const overridedModelName = getClientNameOverride(dpgContext, model) ??
746+
const overridedModelName = getClientNameOverride(dpgContext, model, "powershell") ??
747747
getFriendlyName(program, model) ?? getWireName(dpgContext, model);
748748

749749
const fullNamespaceName =

tests-upgrade/tests-emitter/EmitterTest.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function GenerateModuleWithEmitter {
5050
[TestEmitterModel]
5151
$TestEmitter
5252
)
53-
$result = (tsp compile ./ --emit $script:PowerShellEmitter) | Out-String
53+
$tspFile = if (Test-Path "./client.tsp") { "./client.tsp" } else { "./" }
54+
$result = (tsp compile $tspFile --emit $script:PowerShellEmitter) | Out-String
5455
Write-Debug "$($TestEmitter.TestName) generated powershell debug information"
5556
Write-Debug $result
5657

0 commit comments

Comments
 (0)