-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #3987
- Loading branch information
Showing
9 changed files
with
210 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ient-csharp/generator/TestProjects/CadlRanch.Tests/Http/Server/Path/Single/SingleTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using NUnit.Framework; | ||
using Server.Path.Single; | ||
using System.Threading.Tasks; | ||
|
||
namespace TestProjects.CadlRanch.Tests.Http.Server.Path.Single | ||
{ | ||
public class SingleTests : CadlRanchTestBase | ||
{ | ||
[CadlRanchTest] | ||
public Task MyOp() => Test(async (host) => | ||
{ | ||
var result = await new SingleClient(host, null).MyOpAsync(); | ||
Assert.AreEqual(200, result.GetRawResponse().Status); | ||
}); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/Configuration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"output-folder": ".", | ||
"namespace": "Server.Path.Single", | ||
"library-name": "Server.Path.Single", | ||
"use-model-reader-writer": true | ||
} |
48 changes: 48 additions & 0 deletions
48
...nt-csharp/generator/TestProjects/CadlRanch/http/server/path/single/Server.Path.Single.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29709.97 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.Path.Single", "src\Server.Path.Single.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} | ||
EndGlobalSection | ||
EndGlobal |
30 changes: 30 additions & 0 deletions
30
...rp/generator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.ClientModel; | ||
using System.ClientModel.Primitives; | ||
using System.Threading.Tasks; | ||
|
||
namespace Server.Path.Single | ||
{ | ||
public partial class SingleClient | ||
{ | ||
protected SingleClient() => throw null; | ||
|
||
public SingleClient(Uri endpoint) : this(endpoint, new SingleClientOptions()) => throw null; | ||
|
||
public SingleClient(Uri endpoint, SingleClientOptions options) => throw null; | ||
|
||
public ClientPipeline Pipeline => throw null; | ||
|
||
public virtual ClientResult MyOp(RequestOptions options) => throw null; | ||
|
||
public virtual Task<ClientResult> MyOpAsync(RequestOptions options) => throw null; | ||
|
||
public virtual ClientResult MyOp() => throw null; | ||
|
||
public virtual Task<ClientResult> MyOpAsync() => throw null; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...rator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClientOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.ClientModel.Primitives; | ||
|
||
namespace Server.Path.Single | ||
{ | ||
public partial class SingleClientOptions : ClientPipelineOptions | ||
{ | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...rp/generator/TestProjects/CadlRanch/http/server/path/single/src/Server.Path.Single.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Description>This is the Server.Path.Single client library for developing .NET applications with rich experience.</Description> | ||
<AssemblyTitle>SDK Code Generation Server.Path.Single</AssemblyTitle> | ||
<Version>1.0.0-beta.1</Version> | ||
<PackageTags>Server.Path.Single</PackageTags> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.ClientModel" Version="1.1.0-beta.4" /> | ||
<PackageReference Include="System.Text.Json" Version="8.0.4" /> | ||
</ItemGroup> | ||
</Project> |
74 changes: 74 additions & 0 deletions
74
...-client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/tspCodeModel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"$id": "1", | ||
"Name": "Server.Path.Single", | ||
"ApiVersions": [], | ||
"Enums": [], | ||
"Models": [], | ||
"Clients": [ | ||
{ | ||
"$id": "2", | ||
"Name": "SingleClient", | ||
"Description": "Illustrates server with a single path parameter @server", | ||
"Operations": [ | ||
{ | ||
"$id": "3", | ||
"Name": "myOp", | ||
"ResourceName": "Single", | ||
"Accessibility": "public", | ||
"Parameters": [ | ||
{ | ||
"$id": "4", | ||
"Name": "endpoint", | ||
"NameInRequest": "endpoint", | ||
"Description": "Need to be set as 'http://localhost:3000' in client.", | ||
"Type": { | ||
"$id": "5", | ||
"kind": "url", | ||
"name": "url", | ||
"crossLanguageDefinitionId": "TypeSpec.url" | ||
}, | ||
"Location": "Uri", | ||
"IsApiVersion": false, | ||
"IsResourceParameter": false, | ||
"IsContentType": false, | ||
"IsRequired": true, | ||
"IsEndpoint": true, | ||
"SkipUrlEncoding": false, | ||
"Explode": false, | ||
"Kind": "Client" | ||
} | ||
], | ||
"Responses": [ | ||
{ | ||
"$id": "6", | ||
"StatusCodes": [ | ||
200 | ||
], | ||
"BodyMediaType": "Json", | ||
"Headers": [], | ||
"IsErrorResponse": false | ||
} | ||
], | ||
"HttpMethod": "HEAD", | ||
"RequestBodyMediaType": "None", | ||
"Uri": "{endpoint}", | ||
"Path": "/server/path/single/myOp", | ||
"BufferResponse": true, | ||
"GenerateProtocolMethod": true, | ||
"GenerateConvenienceMethod": true, | ||
"CrossLanguageDefinitionId": "Server.Path.Single.myOp", | ||
"Decorators": [] | ||
} | ||
], | ||
"Protocol": { | ||
"$id": "7" | ||
}, | ||
"Parameters": [ | ||
{ | ||
"$ref": "4" | ||
} | ||
], | ||
"Decorators": [] | ||
} | ||
] | ||
} |