Adopt http/type/model/usage (#4237)
Fixes https://github.com/microsoft/typespec/issues/4000
This commit is contained in:
Родитель
91dd18bfdb
Коммит
7997d9dd44
|
@ -74,7 +74,6 @@ $failingSpecs = @(
|
|||
Join-Path 'http' 'special-headers' 'repeatability'
|
||||
Join-Path 'http' 'type' 'dictionary'
|
||||
Join-Path 'http' 'type' 'model' 'flatten'
|
||||
Join-Path 'http' 'type' 'model' 'usage'
|
||||
Join-Path 'http' 'type' 'model' 'visibility'
|
||||
Join-Path 'http' 'type' 'model' 'inheritance' 'enum-discriminator'
|
||||
Join-Path 'http' 'type' 'model' 'inheritance' 'nested-discriminator'
|
||||
|
|
|
@ -75,6 +75,11 @@
|
|||
"commandName": "Executable",
|
||||
"executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe"
|
||||
},
|
||||
"http-type-model-usage": {
|
||||
"commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/type/model/usage -p StubLibraryPlugin",
|
||||
"commandName": "Executable",
|
||||
"executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe"
|
||||
},
|
||||
"http-type-scalar": {
|
||||
"commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/type/scalar -p StubLibraryPlugin",
|
||||
"commandName": "Executable",
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using _Type.Model.Usage;
|
||||
using _Type.Model.Usage.Models;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace TestProjects.CadlRanch.Tests.Http._Type.Model.Usage
|
||||
{
|
||||
internal class UsageTests : CadlRanchTestBase
|
||||
{
|
||||
[CadlRanchTest]
|
||||
public Task Type_Model_Usage_input() => Test(async (host) =>
|
||||
{
|
||||
var response = await new UsageClient(host, null).InputAsync(new InputRecord("example-value"));
|
||||
Assert.AreEqual(204, response.GetRawResponse().Status);
|
||||
});
|
||||
|
||||
[CadlRanchTest]
|
||||
public Task Type_Model_Usage_output() => Test(async (host) =>
|
||||
{
|
||||
OutputRecord response = await new UsageClient(host, null).OutputAsync();
|
||||
Assert.AreEqual("example-value", response.RequiredProp);
|
||||
});
|
||||
|
||||
[CadlRanchTest]
|
||||
public Task Type_Model_Usage_inputAndOutput() => Test(async (host) =>
|
||||
{
|
||||
InputOutputRecord response = await new UsageClient(host, null).InputAndOutputAsync(new InputOutputRecord("example-value"));
|
||||
Assert.AreEqual("example-value", response.RequiredProp);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"output-folder": ".",
|
||||
"namespace": "Type.Model.Usage",
|
||||
"library-name": "Type.Model.Usage",
|
||||
"use-model-reader-writer": true
|
||||
}
|
|
@ -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}") = "_Type.Model.Usage", "src\_Type.Model.Usage.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
|
|
@ -0,0 +1,36 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.ClientModel;
|
||||
using System.ClientModel.Primitives;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class InputOutputRecord : IJsonModel<InputOutputRecord>
|
||||
{
|
||||
void IJsonModel<InputOutputRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
InputOutputRecord IJsonModel<InputOutputRecord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual InputOutputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
BinaryData IPersistableModel<InputOutputRecord>.Write(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
InputOutputRecord IPersistableModel<InputOutputRecord>.Create(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual InputOutputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
string IPersistableModel<InputOutputRecord>.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
public static implicit operator BinaryContent(InputOutputRecord inputOutputRecord) => throw null;
|
||||
|
||||
public static explicit operator InputOutputRecord(ClientResult result) => throw null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class InputOutputRecord
|
||||
{
|
||||
public InputOutputRecord(string requiredProp) => throw null;
|
||||
|
||||
public string RequiredProp
|
||||
{
|
||||
get => throw null;
|
||||
set => throw null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.ClientModel;
|
||||
using System.ClientModel.Primitives;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class InputRecord : IJsonModel<InputRecord>
|
||||
{
|
||||
void IJsonModel<InputRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
InputRecord IJsonModel<InputRecord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual InputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
BinaryData IPersistableModel<InputRecord>.Write(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
InputRecord IPersistableModel<InputRecord>.Create(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual InputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
string IPersistableModel<InputRecord>.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
public static implicit operator BinaryContent(InputRecord inputRecord) => throw null;
|
||||
|
||||
public static explicit operator InputRecord(ClientResult result) => throw null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class InputRecord
|
||||
{
|
||||
public InputRecord(string requiredProp) => throw null;
|
||||
|
||||
public string RequiredProp
|
||||
{
|
||||
get => throw null;
|
||||
set => throw null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.ClientModel;
|
||||
using System.ClientModel.Primitives;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class OutputRecord : IJsonModel<OutputRecord>
|
||||
{
|
||||
void IJsonModel<OutputRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
OutputRecord IJsonModel<OutputRecord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual OutputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
BinaryData IPersistableModel<OutputRecord>.Write(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
OutputRecord IPersistableModel<OutputRecord>.Create(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
protected virtual OutputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
string IPersistableModel<OutputRecord>.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null;
|
||||
|
||||
public static implicit operator BinaryContent(OutputRecord outputRecord) => throw null;
|
||||
|
||||
public static explicit operator OutputRecord(ClientResult result) => throw null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public partial class OutputRecord
|
||||
{
|
||||
public string RequiredProp
|
||||
{
|
||||
get => throw null;
|
||||
set => throw null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace _Type.Model.Usage.Models
|
||||
{
|
||||
public static partial class TypeModelUsageModelFactory
|
||||
{
|
||||
public static InputRecord InputRecord(string requiredProp = default) => throw null;
|
||||
|
||||
public static OutputRecord OutputRecord(string requiredProp = default) => throw null;
|
||||
|
||||
public static InputOutputRecord InputOutputRecord(string requiredProp = default) => throw null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.ClientModel;
|
||||
using System.ClientModel.Primitives;
|
||||
using System.Threading.Tasks;
|
||||
using _Type.Model.Usage.Models;
|
||||
|
||||
namespace _Type.Model.Usage
|
||||
{
|
||||
public partial class UsageClient
|
||||
{
|
||||
public UsageClient() : this(new Uri("http://localhost:3000"), new UsageClientOptions()) => throw null;
|
||||
|
||||
public UsageClient(Uri endpoint, UsageClientOptions options) => throw null;
|
||||
|
||||
public ClientPipeline Pipeline => throw null;
|
||||
|
||||
public virtual ClientResult Input(BinaryContent content, RequestOptions options) => throw null;
|
||||
|
||||
public virtual Task<ClientResult> InputAsync(BinaryContent content, RequestOptions options) => throw null;
|
||||
|
||||
public virtual ClientResult Input(InputRecord input) => throw null;
|
||||
|
||||
public virtual Task<ClientResult> InputAsync(InputRecord input) => throw null;
|
||||
|
||||
public virtual ClientResult Output(RequestOptions options) => throw null;
|
||||
|
||||
public virtual Task<ClientResult> OutputAsync(RequestOptions options) => throw null;
|
||||
|
||||
public virtual ClientResult<OutputRecord> Output() => throw null;
|
||||
|
||||
public virtual Task<ClientResult<OutputRecord>> OutputAsync() => throw null;
|
||||
|
||||
public virtual ClientResult InputAndOutput(BinaryContent content, RequestOptions options) => throw null;
|
||||
|
||||
public virtual Task<ClientResult> InputAndOutputAsync(BinaryContent content, RequestOptions options) => throw null;
|
||||
|
||||
public virtual ClientResult<InputOutputRecord> InputAndOutput(InputOutputRecord body) => throw null;
|
||||
|
||||
public virtual Task<ClientResult<InputOutputRecord>> InputAndOutputAsync(InputOutputRecord body) => throw null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.ClientModel.Primitives;
|
||||
|
||||
namespace _Type.Model.Usage
|
||||
{
|
||||
public partial class UsageClientOptions : ClientPipelineOptions
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Description>This is the _Type.Model.Usage client library for developing .NET applications with rich experience.</Description>
|
||||
<AssemblyTitle>SDK Code Generation _Type.Model.Usage</AssemblyTitle>
|
||||
<Version>1.0.0-beta.1</Version>
|
||||
<PackageTags>_Type.Model.Usage</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>
|
|
@ -0,0 +1,383 @@
|
|||
{
|
||||
"$id": "1",
|
||||
"Name": "Type.Model.Usage",
|
||||
"ApiVersions": [],
|
||||
"Enums": [],
|
||||
"Models": [
|
||||
{
|
||||
"$id": "2",
|
||||
"Kind": "model",
|
||||
"Name": "InputRecord",
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.InputRecord",
|
||||
"Usage": "Input,Json",
|
||||
"Description": "Record used in operation parameters",
|
||||
"Decorators": [],
|
||||
"Properties": [
|
||||
{
|
||||
"$id": "3",
|
||||
"Name": "requiredProp",
|
||||
"SerializedName": "requiredProp",
|
||||
"Description": "",
|
||||
"Type": {
|
||||
"$id": "4",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"IsRequired": true,
|
||||
"IsReadOnly": false,
|
||||
"Decorators": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$id": "5",
|
||||
"Kind": "model",
|
||||
"Name": "OutputRecord",
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.OutputRecord",
|
||||
"Usage": "Output,Json",
|
||||
"Description": "Record used in operation return type",
|
||||
"Decorators": [],
|
||||
"Properties": [
|
||||
{
|
||||
"$id": "6",
|
||||
"Name": "requiredProp",
|
||||
"SerializedName": "requiredProp",
|
||||
"Description": "",
|
||||
"Type": {
|
||||
"$id": "7",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"IsRequired": true,
|
||||
"IsReadOnly": false,
|
||||
"Decorators": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$id": "8",
|
||||
"Kind": "model",
|
||||
"Name": "InputOutputRecord",
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.InputOutputRecord",
|
||||
"Usage": "Input,Output,Json",
|
||||
"Description": "Record used both as operation parameter and return type",
|
||||
"Decorators": [],
|
||||
"Properties": [
|
||||
{
|
||||
"$id": "9",
|
||||
"Name": "requiredProp",
|
||||
"SerializedName": "requiredProp",
|
||||
"Description": "",
|
||||
"Type": {
|
||||
"$id": "10",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"IsRequired": true,
|
||||
"IsReadOnly": false,
|
||||
"Decorators": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Clients": [
|
||||
{
|
||||
"$id": "11",
|
||||
"Name": "UsageClient",
|
||||
"Description": "Illustrates usage of Record in different places(Operation parameters, return type or both).",
|
||||
"Operations": [
|
||||
{
|
||||
"$id": "12",
|
||||
"Name": "input",
|
||||
"ResourceName": "Usage",
|
||||
"Accessibility": "public",
|
||||
"Parameters": [
|
||||
{
|
||||
"$id": "13",
|
||||
"Name": "endpoint",
|
||||
"NameInRequest": "endpoint",
|
||||
"Type": {
|
||||
"$id": "14",
|
||||
"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",
|
||||
"DefaultValue": {
|
||||
"$id": "15",
|
||||
"Type": {
|
||||
"$id": "16",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string"
|
||||
},
|
||||
"Value": "http://localhost:3000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$id": "17",
|
||||
"Name": "contentType",
|
||||
"NameInRequest": "Content-Type",
|
||||
"Description": "Body parameter's content type. Known values are application/json",
|
||||
"Type": {
|
||||
"$id": "18",
|
||||
"Kind": "constant",
|
||||
"ValueType": {
|
||||
"$id": "19",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"Value": "application/json",
|
||||
"Decorators": []
|
||||
},
|
||||
"Location": "Header",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": true,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Constant",
|
||||
"Decorators": []
|
||||
},
|
||||
{
|
||||
"$id": "20",
|
||||
"Name": "input",
|
||||
"NameInRequest": "input",
|
||||
"Type": {
|
||||
"$ref": "2"
|
||||
},
|
||||
"Location": "Body",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": false,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Method",
|
||||
"Decorators": []
|
||||
}
|
||||
],
|
||||
"Responses": [
|
||||
{
|
||||
"$id": "21",
|
||||
"StatusCodes": [
|
||||
204
|
||||
],
|
||||
"BodyMediaType": "Json",
|
||||
"Headers": [],
|
||||
"IsErrorResponse": false
|
||||
}
|
||||
],
|
||||
"HttpMethod": "POST",
|
||||
"RequestBodyMediaType": "Json",
|
||||
"Uri": "{endpoint}",
|
||||
"Path": "/type/model/usage/input",
|
||||
"RequestMediaTypes": [
|
||||
"application/json"
|
||||
],
|
||||
"BufferResponse": true,
|
||||
"GenerateProtocolMethod": true,
|
||||
"GenerateConvenienceMethod": true,
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.input",
|
||||
"Decorators": []
|
||||
},
|
||||
{
|
||||
"$id": "22",
|
||||
"Name": "output",
|
||||
"ResourceName": "Usage",
|
||||
"Accessibility": "public",
|
||||
"Parameters": [
|
||||
{
|
||||
"$ref": "13"
|
||||
},
|
||||
{
|
||||
"$id": "23",
|
||||
"Name": "accept",
|
||||
"NameInRequest": "Accept",
|
||||
"Type": {
|
||||
"$id": "24",
|
||||
"Kind": "constant",
|
||||
"ValueType": {
|
||||
"$id": "25",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"Value": "application/json",
|
||||
"Decorators": []
|
||||
},
|
||||
"Location": "Header",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": false,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Constant",
|
||||
"Decorators": []
|
||||
}
|
||||
],
|
||||
"Responses": [
|
||||
{
|
||||
"$id": "26",
|
||||
"StatusCodes": [
|
||||
200
|
||||
],
|
||||
"BodyType": {
|
||||
"$ref": "5"
|
||||
},
|
||||
"BodyMediaType": "Json",
|
||||
"Headers": [],
|
||||
"IsErrorResponse": false,
|
||||
"ContentTypes": [
|
||||
"application/json"
|
||||
]
|
||||
}
|
||||
],
|
||||
"HttpMethod": "GET",
|
||||
"RequestBodyMediaType": "None",
|
||||
"Uri": "{endpoint}",
|
||||
"Path": "/type/model/usage/output",
|
||||
"BufferResponse": true,
|
||||
"GenerateProtocolMethod": true,
|
||||
"GenerateConvenienceMethod": true,
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.output",
|
||||
"Decorators": []
|
||||
},
|
||||
{
|
||||
"$id": "27",
|
||||
"Name": "inputAndOutput",
|
||||
"ResourceName": "Usage",
|
||||
"Accessibility": "public",
|
||||
"Parameters": [
|
||||
{
|
||||
"$ref": "13"
|
||||
},
|
||||
{
|
||||
"$id": "28",
|
||||
"Name": "contentType",
|
||||
"NameInRequest": "Content-Type",
|
||||
"Description": "Body parameter's content type. Known values are application/json",
|
||||
"Type": {
|
||||
"$id": "29",
|
||||
"Kind": "constant",
|
||||
"ValueType": {
|
||||
"$id": "30",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"Value": "application/json",
|
||||
"Decorators": []
|
||||
},
|
||||
"Location": "Header",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": true,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Constant",
|
||||
"Decorators": []
|
||||
},
|
||||
{
|
||||
"$id": "31",
|
||||
"Name": "accept",
|
||||
"NameInRequest": "Accept",
|
||||
"Type": {
|
||||
"$id": "32",
|
||||
"Kind": "constant",
|
||||
"ValueType": {
|
||||
"$id": "33",
|
||||
"Kind": "string",
|
||||
"Name": "string",
|
||||
"CrossLanguageDefinitionId": "TypeSpec.string",
|
||||
"Decorators": []
|
||||
},
|
||||
"Value": "application/json",
|
||||
"Decorators": []
|
||||
},
|
||||
"Location": "Header",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": false,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Constant",
|
||||
"Decorators": []
|
||||
},
|
||||
{
|
||||
"$id": "34",
|
||||
"Name": "body",
|
||||
"NameInRequest": "body",
|
||||
"Type": {
|
||||
"$ref": "8"
|
||||
},
|
||||
"Location": "Body",
|
||||
"IsApiVersion": false,
|
||||
"IsContentType": false,
|
||||
"IsEndpoint": false,
|
||||
"Explode": false,
|
||||
"IsRequired": true,
|
||||
"Kind": "Method",
|
||||
"Decorators": []
|
||||
}
|
||||
],
|
||||
"Responses": [
|
||||
{
|
||||
"$id": "35",
|
||||
"StatusCodes": [
|
||||
200
|
||||
],
|
||||
"BodyType": {
|
||||
"$ref": "8"
|
||||
},
|
||||
"BodyMediaType": "Json",
|
||||
"Headers": [],
|
||||
"IsErrorResponse": false,
|
||||
"ContentTypes": [
|
||||
"application/json"
|
||||
]
|
||||
}
|
||||
],
|
||||
"HttpMethod": "POST",
|
||||
"RequestBodyMediaType": "Json",
|
||||
"Uri": "{endpoint}",
|
||||
"Path": "/type/model/usage/input-output",
|
||||
"RequestMediaTypes": [
|
||||
"application/json"
|
||||
],
|
||||
"BufferResponse": true,
|
||||
"GenerateProtocolMethod": true,
|
||||
"GenerateConvenienceMethod": true,
|
||||
"CrossLanguageDefinitionId": "Type.Model.Usage.inputAndOutput",
|
||||
"Decorators": []
|
||||
}
|
||||
],
|
||||
"Protocol": {
|
||||
"$id": "36"
|
||||
},
|
||||
"Parameters": [
|
||||
{
|
||||
"$ref": "13"
|
||||
}
|
||||
],
|
||||
"Decorators": []
|
||||
}
|
||||
]
|
||||
}
|
Загрузка…
Ссылка в новой задаче