diff --git a/src/TypeSpec.Extension/Emitter.Csharp/src/lib/converter.ts b/src/TypeSpec.Extension/Emitter.Csharp/src/lib/converter.ts index 73de7dde098..0e0d85f23c3 100644 --- a/src/TypeSpec.Extension/Emitter.Csharp/src/lib/converter.ts +++ b/src/TypeSpec.Extension/Emitter.Csharp/src/lib/converter.ts @@ -26,10 +26,7 @@ import { DurationKnownEncoding, EncodeData, IntrinsicType, - Model, - Program, - Type, - getFormat + Model } from "@typespec/compiler"; import { Logger } from "./logger.js"; import { getFullNamespaceString } from "./utils.js"; @@ -78,15 +75,13 @@ export function fromSdkType( return fromSdkConstantType(sdkType, enums, literalTypeContext); if (sdkType.kind === "union") return fromUnionType(sdkType, context, models, enums); - if (sdkType.kind === "utcDateTime") return fromSdkDatetimeType(sdkType); - if (sdkType.kind === "duration") - return fromSdkDurationType(sdkType as SdkDurationType); - if (sdkType.kind === "bytes") - return fromBytesType(sdkType as SdkBuiltInType); - if (sdkType.kind === "string") - return fromStringType(context.program, sdkType); - // TODO: offsetDateTime + if (sdkType.kind === "utcDateTime" || sdkType.kind == "offsetDateTime") + return fromSdkDatetimeType(sdkType); + if (sdkType.kind === "duration") return fromSdkDurationType(sdkType); + if (sdkType.kind === "bytes") return fromBytesType(sdkType); + if (sdkType.kind === "string") return fromStringType(sdkType); if (sdkType.kind === "tuple") return fromTupleType(sdkType); + // TODO -- refine the other types from TCGC if (sdkType.__raw?.kind === "Scalar") return fromScalarType(sdkType); // this happens for discriminator type, normally all other primitive types should be handled in scalar above // TODO: can we improve the type in TCGC around discriminator @@ -96,32 +91,6 @@ export function fromSdkType( return {} as InputType; } -// TODO -- this is workaround because TCGC ignore format, we need to remove this after a discussion on format. -// this function is only for the case when we get a type from a parameter, because in typespec, the parameters share the same type as the properties -export function fromSdkModelPropertyType( - propertyType: SdkModelPropertyType, - context: SdkContext, - models: Map, - enums: Map, - literalTypeContext?: LiteralTypeContext -): InputType { - // when the type is string, we need to add the format - if (propertyType.type.kind === "string") { - return fromStringType( - context.program, - propertyType.type, - propertyType.__raw - ); - } - return fromSdkType( - propertyType.type, - context, - models, - enums, - literalTypeContext - ); -} - export function fromSdkModelType( modelType: SdkModelType, context: SdkContext, @@ -418,41 +387,10 @@ function fromBytesType(bytesType: SdkBuiltInType): InputPrimitiveType { }; } -function fromStringType( - program: Program, - stringType: SdkType, - // we need the extra raw here because the format decorator is added to the property/parameter, but the raw in stringType is the type itself, and it does not have the format decorator we want. - // only when we get the type from a parameter, we need to pass the the parameter as raw here to get the format - // TODO -- we should remove this entirely later because TCGC ignores format in these cases, we add it now because we have old test projects, and we did not discuss the impact yet - raw?: Type -): InputPrimitiveType { - function fromStringFormat(rawStringType?: Type): InputPrimitiveTypeKind { - if (!rawStringType) return InputPrimitiveTypeKind.String; - - const format = getFormat(program, rawStringType); - switch (format) { - case "date": - // TODO: remove - return InputPrimitiveTypeKind.DateTime; - case "uri": - case "url": - return InputPrimitiveTypeKind.Uri; - case "uuid": - return InputPrimitiveTypeKind.Guid; - default: - if (format) { - Logger.getInstance().warn( - `Invalid string format '${format}'` - ); - } - return InputPrimitiveTypeKind.String; - } - } - - raw = raw ?? stringType.__raw; +function fromStringType(stringType: SdkType): InputPrimitiveType { return { Kind: InputTypeKind.Primitive, - Name: fromStringFormat(raw), + Name: InputPrimitiveTypeKind.String, IsNullable: stringType.nullable }; } @@ -548,7 +486,6 @@ function fromScalarType(scalarType: SdkType): InputPrimitiveType { return { Kind: InputTypeKind.Primitive, Name: getCSharpInputTypeKindByPrimitiveModelName( - scalarType.kind, scalarType.kind, undefined // To-DO: encode not compatible ), @@ -557,7 +494,6 @@ function fromScalarType(scalarType: SdkType): InputPrimitiveType { function getCSharpInputTypeKindByPrimitiveModelName( name: string, - format?: string, encode?: EncodeData ): InputPrimitiveTypeKind { switch (name) { @@ -602,22 +538,7 @@ function fromScalarType(scalarType: SdkType): InputPrimitiveType { case "eTag": return InputPrimitiveTypeKind.String; case "string": - switch (format?.toLowerCase()) { - case "date": - return InputPrimitiveTypeKind.DateTime; - case "uri": - case "url": - return InputPrimitiveTypeKind.Uri; - case "uuid": - return InputPrimitiveTypeKind.Guid; - default: - if (format) { - Logger.getInstance().warn( - `invalid format ${format}` - ); - } - return InputPrimitiveTypeKind.String; - } + return InputPrimitiveTypeKind.String; case "boolean": return InputPrimitiveTypeKind.Boolean; case "date": @@ -656,6 +577,8 @@ function fromScalarType(scalarType: SdkType): InputPrimitiveType { encode.type?.name === "float32" ) { return InputPrimitiveTypeKind.DurationSecondsFloat; + } else if (encode.type?.name === "float64") { + return InputPrimitiveTypeKind.DurationSecondsDouble; } else { return InputPrimitiveTypeKind.DurationSeconds; } diff --git a/src/TypeSpec.Extension/Emitter.Csharp/src/lib/model.ts b/src/TypeSpec.Extension/Emitter.Csharp/src/lib/model.ts index e2deef3e01e..eda1c1ba36e 100644 --- a/src/TypeSpec.Extension/Emitter.Csharp/src/lib/model.ts +++ b/src/TypeSpec.Extension/Emitter.Csharp/src/lib/model.ts @@ -5,8 +5,7 @@ import { getLroMetadata } from "@azure-tools/typespec-azure-core"; import { SdkContext, getAllModels, - getClientType, - getSdkModelPropertyType + getClientType } from "@azure-tools/typespec-client-generator-core"; import { Model, @@ -15,7 +14,6 @@ import { Type, UsageFlags, getEffectiveModelType, - ignoreDiagnostics, isArrayModelType, isRecordModelType, resolveUsages @@ -28,12 +26,7 @@ import { isStatusCode } from "@typespec/http"; import { NetEmitterOptions } from "../options.js"; -import { - fromSdkEnumType, - fromSdkModelPropertyType, - fromSdkModelType, - fromSdkType -} from "./converter.js"; +import { fromSdkEnumType, fromSdkModelType, fromSdkType } from "./converter.js"; import { InputEnumType, InputModelType, @@ -109,22 +102,6 @@ export function getInputType( ): InputType { Logger.getInstance().debug(`getInputType for kind: ${type.kind}`); - // TODO -- we might could remove this workaround when we adopt getAllOperations - // or when we decide not to honor the `@format` decorators on parameters - // this is specifically dealing with the case of an operation parameter - if (type.kind === "ModelProperty") { - const propertyType = ignoreDiagnostics( - getSdkModelPropertyType(context, type, operation) - ); - return fromSdkModelPropertyType( - propertyType, - context, - models, - enums, - literalTypeContext - ); - } - const sdkType = getClientType(context, type, operation); return fromSdkType(sdkType, context, models, enums, literalTypeContext); } diff --git a/src/TypeSpec.Extension/Emitter.Csharp/test/Unit/string-format.test.ts b/src/TypeSpec.Extension/Emitter.Csharp/test/Unit/string-format.test.ts index f42c2d0da12..5f54b5f76ad 100644 --- a/src/TypeSpec.Extension/Emitter.Csharp/test/Unit/string-format.test.ts +++ b/src/TypeSpec.Extension/Emitter.Csharp/test/Unit/string-format.test.ts @@ -88,137 +88,4 @@ describe("Test string format", () => { ) ); }); - - it("format uri on operation parameter", async () => { - const program = await typeSpecCompile( - ` - op test(@path @format("uri")sourceUrl: string): void; - `, - runner - ); - const context = createEmitterContext(program); - const sdkContext = createNetSdkContext(context); - const [services] = getAllHttpServices(program); - const modelMap = new Map(); - const enumMap = new Map(); - const operation = loadOperation( - sdkContext, - services[0].operations[0], - "", - [], - services[0].namespace, - modelMap, - enumMap - ); - assert( - isEqual( - { - Kind: InputTypeKind.Primitive, - Name: InputPrimitiveTypeKind.Uri, - IsNullable: false - }, - operation.Parameters[0].Type - ) - ); - }); - - it("format uri on model property", async () => { - const program = await typeSpecCompile( - ` - @doc("This is a model.") - model Foo { - @doc("The source url.") - @format("uri") - source: string - } - `, - runner - ); - const context = createEmitterContext(program); - const sdkContext = createNetSdkContext(context); - const [services] = getAllHttpServices(program); - const modelMap = new Map(); - const enumMap = new Map(); - navigateModels(sdkContext, services[0].namespace, modelMap, enumMap); - const foo = modelMap.get("Foo"); - assert(foo !== undefined); - assert( - isEqual( - { - Kind: InputTypeKind.Primitive, - Name: InputPrimitiveTypeKind.Uri, - IsNullable: false - }, - foo.Properties[0].Type - ), - `string property format is not correct. Got ${JSON.stringify( - foo.Properties[0].Type - )} ` - ); - }); - - it("format uuid on operation parameter", async () => { - const program = await typeSpecCompile( - ` - op test(@path @format("uuid")subscriptionId: string): void; - `, - runner - ); - const context = createEmitterContext(program); - const sdkContext = createNetSdkContext(context); - const [services] = getAllHttpServices(program); - const modelMap = new Map(); - const enumMap = new Map(); - const operation = loadOperation( - sdkContext, - services[0].operations[0], - "", - [], - services[0].namespace, - modelMap, - enumMap - ); - assert( - isEqual( - { - Kind: InputTypeKind.Primitive, - Name: InputPrimitiveTypeKind.Guid, - IsNullable: false - }, - operation.Parameters[0].Type - ) - ); - }); - - it("format on model property", async () => { - const program = await typeSpecCompile( - ` - @doc("This is a model.") - model Foo { - @doc("The subscription id.") - @format("uuid") - subscriptionId: string - } - `, - runner - ); - const context = createEmitterContext(program); - const sdkContext = createNetSdkContext(context); - const [services] = getAllHttpServices(program); - const modelMap = new Map(); - const enumMap = new Map(); - navigateModels(sdkContext, services[0].namespace, modelMap, enumMap); - const foo = modelMap.get("Foo"); - assert(foo !== undefined); - assert( - isEqual( - { - Kind: InputTypeKind.Primitive, - Name: InputPrimitiveTypeKind.Guid, - IsNullable: false - } as InputPrimitiveType, - foo.Properties[0].Type - ) - ); - }); }); diff --git a/test/TestProjects/FirstTest-TypeSpec/FirstTest-TypeSpec.tsp b/test/TestProjects/FirstTest-TypeSpec/FirstTest-TypeSpec.tsp index fa68ab061d4..ffec18d2465 100644 --- a/test/TestProjects/FirstTest-TypeSpec/FirstTest-TypeSpec.tsp +++ b/test/TestProjects/FirstTest-TypeSpec/FirstTest-TypeSpec.tsp @@ -246,12 +246,10 @@ union DaysOfWeekExtensibleEnum { model ModelWithFormat { @doc("url format") - @format("uri") - sourceUrl: string; + sourceUrl: url; @doc("uuid format") - @format("uuid") - guid: string; + guid: uuid; } @doc("Hello world service") @@ -311,7 +309,7 @@ namespace Hello.Demo2 { @doc("top level method") @get @convenientAPI(true) -op topAction(@path @format("date") action: string): Thing; +op topAction(@path action: utcDateTime): Thing; @route("/top2") @doc("top level method2") @@ -338,14 +336,14 @@ op anonymousBody(...Thing): Thing; op friendlyModel(...NotFriend): NotFriend; op addTimeHeader( - @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime + @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime ): void; @route("/stringFormat") @doc("paramete has string format.") @post @convenientAPI(true) -op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void; +op stringFormat(@path subscriptionId: uuid, @body body: ModelWithFormat): void; @route("/projectedName") diff --git a/test/TestProjects/FirstTest-TypeSpec/src/Generated/Docs/FirstTestTypeSpecClient.xml b/test/TestProjects/FirstTest-TypeSpec/src/Generated/Docs/FirstTestTypeSpecClient.xml index b4bdf072182..899f94079f0 100644 --- a/test/TestProjects/FirstTest-TypeSpec/src/Generated/Docs/FirstTestTypeSpecClient.xml +++ b/test/TestProjects/FirstTest-TypeSpec/src/Generated/Docs/FirstTestTypeSpecClient.xml @@ -8,14 +8,14 @@ This sample shows how to call TopActionAsync. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> This sample shows how to call TopActionAsync with all parameters. "); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> @@ -25,14 +25,14 @@ This sample shows how to call TopAction. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> This sample shows how to call TopAction with all parameters. "); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> @@ -42,7 +42,7 @@ This sample shows how to call TopActionAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -59,7 +59,7 @@ This sample shows how to call TopActionAsync with all parameters and parse the r Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -84,7 +84,7 @@ This sample shows how to call TopAction and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -101,7 +101,7 @@ This sample shows how to call TopAction with all parameters and parse the result Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); diff --git a/test/TestProjects/FirstTest-TypeSpec/src/Generated/tspCodeModel.json b/test/TestProjects/FirstTest-TypeSpec/src/Generated/tspCodeModel.json index bd5ee6e9131..47d7ab1f4f2 100644 --- a/test/TestProjects/FirstTest-TypeSpec/src/Generated/tspCodeModel.json +++ b/test/TestProjects/FirstTest-TypeSpec/src/Generated/tspCodeModel.json @@ -1567,7 +1567,7 @@ "Type": { "$id": "197", "Kind": "Primitive", - "Name": "DateTime", + "Name": "DateTimeRFC3339", "IsNullable": false }, "Location": "Path", diff --git a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs index baf41fff072..bc84490b72b 100644 --- a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs +++ b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs @@ -26,7 +26,7 @@ public void Example_FirstTestTypeSpec_TopAction_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -46,7 +46,7 @@ public async Task Example_FirstTestTypeSpec_TopAction_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -66,7 +66,7 @@ public void Example_FirstTestTypeSpec_TopAction_ShortVersion_Convenience() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -76,7 +76,7 @@ public async Task Example_FirstTestTypeSpec_TopAction_ShortVersion_Convenience_A Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -86,7 +86,7 @@ public void Example_FirstTestTypeSpec_TopAction_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -111,7 +111,7 @@ public async Task Example_FirstTestTypeSpec_TopAction_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -136,7 +136,7 @@ public void Example_FirstTestTypeSpec_TopAction_AllParameters_Convenience() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -146,7 +146,7 @@ public async Task Example_FirstTestTypeSpec_TopAction_AllParameters_Convenience_ Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] diff --git a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Tests/FirstTestTypeSpecClientTests.cs b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Tests/FirstTestTypeSpecClientTests.cs index 9f95323fc2a..02f00dbeb99 100644 --- a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Tests/FirstTestTypeSpecClientTests.cs +++ b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Tests/FirstTestTypeSpecClientTests.cs @@ -30,7 +30,7 @@ public async Task FirstTestTypeSpec_TopAction_ShortVersion() AzureKeyCredential credential = null; FirstTestTypeSpecClient client = CreateFirstTestTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); } [Test] @@ -41,7 +41,7 @@ public async Task FirstTestTypeSpec_TopAction_ShortVersion_Convenience() AzureKeyCredential credential = null; FirstTestTypeSpecClient client = CreateFirstTestTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -52,7 +52,7 @@ public async Task FirstTestTypeSpec_TopAction_AllParameters() AzureKeyCredential credential = null; FirstTestTypeSpecClient client = CreateFirstTestTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); } [Test] @@ -63,7 +63,7 @@ public async Task FirstTestTypeSpec_TopAction_AllParameters_Convenience() AzureKeyCredential credential = null; FirstTestTypeSpecClient client = CreateFirstTestTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] diff --git a/test/TestProjects/NoDocs-TypeSpec/NoDocs-TypeSpec.tsp b/test/TestProjects/NoDocs-TypeSpec/NoDocs-TypeSpec.tsp index 3c13c78be2f..79b20c26d91 100644 --- a/test/TestProjects/NoDocs-TypeSpec/NoDocs-TypeSpec.tsp +++ b/test/TestProjects/NoDocs-TypeSpec/NoDocs-TypeSpec.tsp @@ -244,16 +244,6 @@ union DaysOfWeekExtensibleEnum { Sunday: "Sunday", } -model ModelWithFormat { - @doc("url format") - @format("uri") - sourceUrl: string; - - @doc("uuid format") - @format("uuid") - guid: string; -} - @doc("Hello world service") @route("/hello") namespace Hello.Demo { @@ -311,7 +301,7 @@ namespace Hello.Demo2 { @doc("top level method") @get @convenientAPI(true) -op topAction(@path @format("date") action: string): Thing; +op topAction(@path action: utcDateTime): Thing; @route("/top2") @doc("top level method2") @@ -341,12 +331,6 @@ op addTimeHeader( @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime ): void; -@route("/stringFormat") -@doc("paramete has string format.") -@post -@convenientAPI(true) -op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void; - @route("/projectedName") @doc("Model can have its projected name") diff --git a/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs b/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs deleted file mode 100644 index 3395f969d87..00000000000 --- a/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace NoDocsTypeSpec.Models -{ - public partial class ModelWithFormat : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("sourceUrl"u8); - writer.WriteStringValue(SourceUrl.AbsoluteUri); - writer.WritePropertyName("guid"u8); - writer.WriteStringValue(Guid); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelWithFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelWithFormat(document.RootElement, options); - } - - internal static ModelWithFormat DeserializeModelWithFormat(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri sourceUrl = default; - Guid guid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceUrl"u8)) - { - sourceUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("guid"u8)) - { - guid = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelWithFormat(sourceUrl, guid, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{options.Format}' format."); - } - } - - ModelWithFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelWithFormat(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - internal static ModelWithFormat FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeModelWithFormat(document.RootElement); - } - - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.cs b/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.cs deleted file mode 100644 index ef35b5dde54..00000000000 --- a/test/TestProjects/NoDocs-TypeSpec/src/Generated/Models/ModelWithFormat.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace NoDocsTypeSpec.Models -{ - public partial class ModelWithFormat - { - private IDictionary _serializedAdditionalRawData; - - public ModelWithFormat(Uri sourceUrl, Guid guid) - { - Argument.AssertNotNull(sourceUrl, nameof(sourceUrl)); - - SourceUrl = sourceUrl; - Guid = guid; - } - - internal ModelWithFormat(Uri sourceUrl, Guid guid, IDictionary serializedAdditionalRawData) - { - SourceUrl = sourceUrl; - Guid = guid; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - internal ModelWithFormat() - { - } - - public Uri SourceUrl { get; } - public Guid Guid { get; } - } -} diff --git a/test/TestProjects/NoDocs-TypeSpec/src/Generated/NoDocsTypeSpecClient.cs b/test/TestProjects/NoDocs-TypeSpec/src/Generated/NoDocsTypeSpecClient.cs index 430061f7229..c1c5005679b 100644 --- a/test/TestProjects/NoDocs-TypeSpec/src/Generated/NoDocsTypeSpecClient.cs +++ b/test/TestProjects/NoDocs-TypeSpec/src/Generated/NoDocsTypeSpecClient.cs @@ -324,62 +324,6 @@ public virtual Response AddTimeHeader(RequestContext context = null) } } - public virtual async Task StringFormatAsync(Guid subscriptionId, ModelWithFormat body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await StringFormatAsync(subscriptionId, content, context).ConfigureAwait(false); - return response; - } - - public virtual Response StringFormat(Guid subscriptionId, ModelWithFormat body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = StringFormat(subscriptionId, content, context); - return response; - } - - public virtual async Task StringFormatAsync(Guid subscriptionId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("NoDocsTypeSpecClient.StringFormat"); - scope.Start(); - try - { - using HttpMessage message = CreateStringFormatRequest(subscriptionId, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - public virtual Response StringFormat(Guid subscriptionId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("NoDocsTypeSpecClient.StringFormat"); - scope.Start(); - try - { - using HttpMessage message = CreateStringFormatRequest(subscriptionId, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - public virtual async Task> ProjectedNameModelAsync(ProjectedModel projectedModel, CancellationToken cancellationToken = default) { Argument.AssertNotNull(projectedModel, nameof(projectedModel)); @@ -1311,22 +1255,6 @@ internal HttpMessage CreateAddTimeHeaderRequest(RequestContext context) return message; } - internal HttpMessage CreateStringFormatRequest(Guid subscriptionId, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/stringFormat/", false); - uri.AppendPath(subscriptionId, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - internal HttpMessage CreateProjectedNameModelRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); diff --git a/test/TestProjects/NoDocs-TypeSpec/src/Generated/tspCodeModel.json b/test/TestProjects/NoDocs-TypeSpec/src/Generated/tspCodeModel.json index 846ef85f79f..e6257b46d39 100644 --- a/test/TestProjects/NoDocs-TypeSpec/src/Generated/tspCodeModel.json +++ b/test/TestProjects/NoDocs-TypeSpec/src/Generated/tspCodeModel.json @@ -707,44 +707,6 @@ { "$id": "94", "Kind": "Model", - "Name": "ModelWithFormat", - "Namespace": "NoDocsTypeSpec", - "IsNullable": false, - "Usage": "Input", - "Properties": [ - { - "$id": "95", - "Name": "sourceUrl", - "SerializedName": "sourceUrl", - "Description": "url format", - "Type": { - "$id": "96", - "Kind": "Primitive", - "Name": "Uri", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - }, - { - "$id": "97", - "Name": "guid", - "SerializedName": "guid", - "Description": "uuid format", - "Type": { - "$id": "98", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - } - ] - }, - { - "$id": "99", - "Kind": "Model", "Name": "ProjectedModel", "Namespace": "NoDocsTypeSpec", "Description": "this is a model with a projected name", @@ -752,12 +714,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "100", + "$id": "95", "Name": "name", "SerializedName": "name", "Description": "name of the ModelWithProjectedName", "Type": { - "$id": "101", + "$id": "96", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -768,7 +730,7 @@ ] }, { - "$id": "102", + "$id": "97", "Kind": "Model", "Name": "ReturnsAnonymousModelResponse", "Namespace": "NoDocsTypeSpec", @@ -777,7 +739,7 @@ "Properties": [] }, { - "$id": "103", + "$id": "98", "Kind": "Model", "Name": "Extension", "Namespace": "NoDocsTypeSpec", @@ -785,7 +747,7 @@ "IsNullable": false, "Usage": "Input", "BaseModel": { - "$id": "104", + "$id": "99", "Kind": "Model", "Name": "Element", "Namespace": "NoDocsTypeSpec", @@ -794,16 +756,16 @@ "Usage": "Input", "Properties": [ { - "$id": "105", + "$id": "100", "Name": "extension", "SerializedName": "extension", "Description": "", "Type": { - "$id": "106", + "$id": "101", "Kind": "Array", "Name": "Array", "ElementType": { - "$ref": "103" + "$ref": "98" }, "IsNullable": false }, @@ -814,12 +776,12 @@ }, "Properties": [ { - "$id": "107", + "$id": "102", "Name": "level", "SerializedName": "level", "Description": "", "Type": { - "$id": "108", + "$id": "103", "Kind": "Primitive", "Name": "SByte", "IsNullable": false @@ -830,10 +792,10 @@ ] }, { - "$ref": "104" + "$ref": "99" }, { - "$id": "109", + "$id": "104", "Kind": "Model", "Name": "Extendible", "Namespace": "NoDocsTypeSpec", @@ -842,16 +804,16 @@ "Usage": "Input", "Properties": [ { - "$id": "110", + "$id": "105", "Name": "extension", "SerializedName": "extension", "Description": "Additional Content defined by implementations", "Type": { - "$id": "111", + "$id": "106", "Kind": "Array", "Name": "Array", "ElementType": { - "$id": "112", + "$id": "107", "Kind": "Model", "Name": "ThereLevelExtension", "Namespace": "NoDocsTypeSpec", @@ -859,7 +821,7 @@ "IsNullable": false, "Usage": "Input", "BaseModel": { - "$id": "113", + "$id": "108", "Kind": "Model", "Name": "ThereLevelElement", "Namespace": "NoDocsTypeSpec", @@ -868,16 +830,16 @@ "Usage": "Input", "Properties": [ { - "$id": "114", + "$id": "109", "Name": "extension", "SerializedName": "extension", "Description": "", "Type": { - "$id": "115", + "$id": "110", "Kind": "Array", "Name": "Array", "ElementType": { - "$ref": "112" + "$ref": "107" }, "IsNullable": false }, @@ -888,12 +850,12 @@ }, "Properties": [ { - "$id": "116", + "$id": "111", "Name": "level", "SerializedName": "level", "Description": "", "Type": { - "$id": "117", + "$id": "112", "Kind": "Primitive", "Name": "SByte", "IsNullable": false @@ -911,13 +873,13 @@ ] }, { - "$ref": "112" + "$ref": "107" }, { - "$ref": "113" + "$ref": "108" }, { - "$id": "118", + "$id": "113", "Kind": "Model", "Name": "ChildModel", "Namespace": "NoDocsTypeSpec", @@ -925,7 +887,7 @@ "IsNullable": false, "Usage": "Input", "BaseModel": { - "$id": "119", + "$id": "114", "Kind": "Model", "Name": "BaseModel", "Namespace": "NoDocsTypeSpec", @@ -934,12 +896,12 @@ "Usage": "Input", "Properties": [ { - "$id": "120", + "$id": "115", "Name": "level", "SerializedName": "level", "Description": "", "Type": { - "$id": "121", + "$id": "116", "Kind": "Primitive", "Name": "SByte", "IsNullable": false @@ -951,16 +913,16 @@ }, "Properties": [ { - "$id": "122", + "$id": "117", "Name": "parent", "SerializedName": "parent", "Description": "", "Type": { - "$id": "123", + "$id": "118", "Kind": "Array", "Name": "Array", "ElementType": { - "$ref": "119" + "$ref": "114" }, "IsNullable": false }, @@ -970,10 +932,10 @@ ] }, { - "$ref": "119" + "$ref": "114" }, { - "$id": "124", + "$id": "119", "Kind": "Model", "Name": "ContainSelf", "Namespace": "NoDocsTypeSpec", @@ -982,12 +944,12 @@ "Usage": "Input", "Properties": [ { - "$id": "125", + "$id": "120", "Name": "self", "SerializedName": "self", "Description": "", "Type": { - "$ref": "124" + "$ref": "119" }, "IsRequired": true, "IsReadOnly": false @@ -995,7 +957,7 @@ ] }, { - "$id": "126", + "$id": "121", "Kind": "Model", "Name": "ModelWithProjectedEnum", "Namespace": "NoDocsTypeSpec", @@ -1003,7 +965,7 @@ "Usage": "Input", "Properties": [ { - "$id": "127", + "$id": "122", "Name": "enumProperty", "SerializedName": "enumProperty", "Description": "enum with projected name used in a model", @@ -1016,7 +978,7 @@ ] }, { - "$id": "128", + "$id": "123", "Kind": "Model", "Name": "AzureLocationModel", "Namespace": "NoDocsTypeSpec", @@ -1024,12 +986,12 @@ "Usage": "Input", "Properties": [ { - "$id": "129", + "$id": "124", "Name": "location", "SerializedName": "location", "Description": "", "Type": { - "$id": "130", + "$id": "125", "Kind": "Primitive", "Name": "AzureLocation", "IsNullable": false @@ -1040,7 +1002,7 @@ ] }, { - "$id": "131", + "$id": "126", "Kind": "Model", "Name": "RoundTripModel", "Namespace": "NoDocsTypeSpec", @@ -1049,12 +1011,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "132", + "$id": "127", "Name": "requiredString", "SerializedName": "requiredString", "Description": "Required string, illustrating a reference type property.", "Type": { - "$id": "133", + "$id": "128", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1063,12 +1025,12 @@ "IsReadOnly": false }, { - "$id": "134", + "$id": "129", "Name": "requiredInt", "SerializedName": "requiredInt", "Description": "Required int, illustrating a value type property.", "Type": { - "$id": "135", + "$id": "130", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -1077,12 +1039,12 @@ "IsReadOnly": false }, { - "$id": "136", + "$id": "131", "Name": "requiredCollection", "SerializedName": "requiredCollection", "Description": "Required collection of enums", "Type": { - "$id": "137", + "$id": "132", "Kind": "Array", "Name": "Array", "ElementType": { @@ -1094,16 +1056,16 @@ "IsReadOnly": false }, { - "$id": "138", + "$id": "133", "Name": "requiredDictionary", "SerializedName": "requiredDictionary", "Description": "Required dictionary of enums", "Type": { - "$id": "139", + "$id": "134", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "140", + "$id": "135", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1117,7 +1079,7 @@ "IsReadOnly": false }, { - "$id": "141", + "$id": "136", "Name": "requiredModel", "SerializedName": "requiredModel", "Description": "Required model", @@ -1128,7 +1090,7 @@ "IsReadOnly": false }, { - "$id": "142", + "$id": "137", "Name": "intExtensibleEnum", "SerializedName": "intExtensibleEnum", "Description": "this is an int based extensible enum", @@ -1139,12 +1101,12 @@ "IsReadOnly": false }, { - "$id": "143", + "$id": "138", "Name": "intExtensibleEnumCollection", "SerializedName": "intExtensibleEnumCollection", "Description": "this is a collection of int based extensible enum", "Type": { - "$id": "144", + "$id": "139", "Kind": "Array", "Name": "Array", "ElementType": { @@ -1156,7 +1118,7 @@ "IsReadOnly": false }, { - "$id": "145", + "$id": "140", "Name": "floatExtensibleEnum", "SerializedName": "floatExtensibleEnum", "Description": "this is a float based extensible enum", @@ -1167,12 +1129,12 @@ "IsReadOnly": false }, { - "$id": "146", + "$id": "141", "Name": "floatExtensibleEnumCollection", "SerializedName": "floatExtensibleEnumCollection", "Description": "this is a collection of float based extensible enum", "Type": { - "$id": "147", + "$id": "142", "Kind": "Array", "Name": "Array", "ElementType": { @@ -1184,7 +1146,7 @@ "IsReadOnly": false }, { - "$id": "148", + "$id": "143", "Name": "floatFixedEnum", "SerializedName": "floatFixedEnum", "Description": "this is a float based fixed enum", @@ -1195,12 +1157,12 @@ "IsReadOnly": false }, { - "$id": "149", + "$id": "144", "Name": "floatFixedEnumCollection", "SerializedName": "floatFixedEnumCollection", "Description": "this is a collection of float based fixed enum", "Type": { - "$id": "150", + "$id": "145", "Kind": "Array", "Name": "Array", "ElementType": { @@ -1212,7 +1174,7 @@ "IsReadOnly": false }, { - "$id": "151", + "$id": "146", "Name": "intFixedEnum", "SerializedName": "intFixedEnum", "Description": "this is a int based fixed enum", @@ -1223,12 +1185,12 @@ "IsReadOnly": false }, { - "$id": "152", + "$id": "147", "Name": "intFixedEnumCollection", "SerializedName": "intFixedEnumCollection", "Description": "this is a collection of int based fixed enum", "Type": { - "$id": "153", + "$id": "148", "Kind": "Array", "Name": "Array", "ElementType": { @@ -1240,7 +1202,7 @@ "IsReadOnly": false }, { - "$id": "154", + "$id": "149", "Name": "stringFixedEnum", "SerializedName": "stringFixedEnum", "Description": "this is a string based fixed enum", @@ -1251,12 +1213,12 @@ "IsReadOnly": false }, { - "$id": "155", + "$id": "150", "Name": "requiredUnknown", "SerializedName": "requiredUnknown", "Description": "required unknown", "Type": { - "$id": "156", + "$id": "151", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1265,12 +1227,12 @@ "IsReadOnly": false }, { - "$id": "157", + "$id": "152", "Name": "optionalUnknown", "SerializedName": "optionalUnknown", "Description": "optional unknown", "Type": { - "$id": "158", + "$id": "153", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1279,22 +1241,22 @@ "IsReadOnly": false }, { - "$id": "159", + "$id": "154", "Name": "requiredRecordUnknown", "SerializedName": "requiredRecordUnknown", "Description": "required record of unknown", "Type": { - "$id": "160", + "$id": "155", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "161", + "$id": "156", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "162", + "$id": "157", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1305,22 +1267,22 @@ "IsReadOnly": false }, { - "$id": "163", + "$id": "158", "Name": "optionalRecordUnknown", "SerializedName": "optionalRecordUnknown", "Description": "optional record of unknown", "Type": { - "$id": "164", + "$id": "159", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "165", + "$id": "160", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "166", + "$id": "161", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1331,22 +1293,22 @@ "IsReadOnly": false }, { - "$id": "167", + "$id": "162", "Name": "readOnlyRequiredRecordUnknown", "SerializedName": "readOnlyRequiredRecordUnknown", "Description": "required readonly record of unknown", "Type": { - "$id": "168", + "$id": "163", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "169", + "$id": "164", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "170", + "$id": "165", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1357,22 +1319,22 @@ "IsReadOnly": true }, { - "$id": "171", + "$id": "166", "Name": "readOnlyOptionalRecordUnknown", "SerializedName": "readOnlyOptionalRecordUnknown", "Description": "optional readonly record of unknown", "Type": { - "$id": "172", + "$id": "167", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "173", + "$id": "168", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "174", + "$id": "169", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -1383,12 +1345,12 @@ "IsReadOnly": true }, { - "$id": "175", + "$id": "170", "Name": "modelWithRequiredNullable", "SerializedName": "modelWithRequiredNullable", "Description": "this is a model with required nullable properties", "Type": { - "$id": "176", + "$id": "171", "Kind": "Model", "Name": "ModelWithRequiredNullableProperties", "Namespace": "NoDocsTypeSpec", @@ -1397,12 +1359,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "177", + "$id": "172", "Name": "requiredNullablePrimitive", "SerializedName": "requiredNullablePrimitive", "Description": "required nullable primitive type", "Type": { - "$id": "178", + "$id": "173", "Kind": "Primitive", "Name": "Int32", "IsNullable": true @@ -1411,7 +1373,7 @@ "IsReadOnly": false }, { - "$id": "179", + "$id": "174", "Name": "requiredExtensibleEnum", "SerializedName": "requiredExtensibleEnum", "Description": "required nullable extensible enum type", @@ -1422,7 +1384,7 @@ "IsReadOnly": false }, { - "$id": "180", + "$id": "175", "Name": "requiredFixedEnum", "SerializedName": "requiredFixedEnum", "Description": "required nullable fixed enum type", @@ -1438,33 +1400,33 @@ "IsReadOnly": false }, { - "$id": "181", + "$id": "176", "Name": "unionList", "SerializedName": "unionList", "Description": "this is a list of union types", "Type": { - "$id": "182", + "$id": "177", "Kind": "Array", "Name": "Array", "ElementType": { - "$id": "183", + "$id": "178", "Kind": "Union", "Name": "Union", "UnionItemTypes": [ { - "$id": "184", + "$id": "179", "Kind": "Primitive", "Name": "String", "IsNullable": false }, { - "$id": "185", + "$id": "180", "Kind": "Primitive", "Name": "Int32", "IsNullable": false }, { - "$id": "186", + "$id": "181", "Kind": "Model", "Name": "ModelForUnion", "Namespace": "NoDocsTypeSpec", @@ -1473,12 +1435,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "187", + "$id": "182", "Name": "name", "SerializedName": "name", "Description": "name of the ModelForUnion", "Type": { - "$id": "188", + "$id": "183", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1487,12 +1449,12 @@ "IsReadOnly": false }, { - "$id": "189", + "$id": "184", "Name": "age", "SerializedName": "age", "Description": "age of the ModelForUnion", "Type": { - "$id": "190", + "$id": "185", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -1503,11 +1465,11 @@ ] }, { - "$id": "191", + "$id": "186", "Kind": "Array", "Name": "Array", "ElementType": { - "$ref": "186" + "$ref": "181" }, "IsNullable": false } @@ -1522,30 +1484,30 @@ ] }, { - "$ref": "176" + "$ref": "171" }, { - "$ref": "186" + "$ref": "181" } ], "Clients": [ { - "$id": "192", + "$id": "187", "Name": "NoDocsTypeSpecClient", "Description": "This is a sample typespec project.", "Operations": [ { - "$id": "193", + "$id": "188", "Name": "topAction", "ResourceName": "NoDocsTypeSpec", "Description": "top level method", "Parameters": [ { - "$id": "194", + "$id": "189", "Name": "endpoint", "NameInRequest": "endpoint", "Type": { - "$id": "195", + "$id": "190", "Kind": "Primitive", "Name": "Uri", "IsNullable": false @@ -1561,13 +1523,13 @@ "Kind": "Client" }, { - "$id": "196", + "$id": "191", "Name": "action", "NameInRequest": "action", "Type": { - "$id": "197", + "$id": "192", "Kind": "Primitive", - "Name": "DateTime", + "Name": "DateTimeRFC3339", "IsNullable": false }, "Location": "Path", @@ -1581,11 +1543,11 @@ "Kind": "Method" }, { - "$id": "198", + "$id": "193", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "199", + "$id": "194", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1600,9 +1562,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "200", + "$id": "195", "Type": { - "$ref": "199" + "$ref": "194" }, "Value": "application/json" } @@ -1610,7 +1572,7 @@ ], "Responses": [ { - "$id": "201", + "$id": "196", "StatusCodes": [ 200 ], @@ -1634,20 +1596,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "202", + "$id": "197", "Name": "topAction2", "ResourceName": "NoDocsTypeSpec", "Description": "top level method2", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "203", + "$id": "198", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "204", + "$id": "199", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1662,9 +1624,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "205", + "$id": "200", "Type": { - "$ref": "204" + "$ref": "199" }, "Value": "application/json" } @@ -1672,7 +1634,7 @@ ], "Responses": [ { - "$id": "206", + "$id": "201", "StatusCodes": [ 200 ], @@ -1696,16 +1658,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "207", + "$id": "202", "Name": "patchAction", "ResourceName": "NoDocsTypeSpec", "Description": "top level patch", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "208", + "$id": "203", "Name": "body", "NameInRequest": "body", "Type": { @@ -1722,11 +1684,11 @@ "Kind": "Method" }, { - "$id": "209", + "$id": "204", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "210", + "$id": "205", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1741,19 +1703,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "211", + "$id": "206", "Type": { - "$ref": "210" + "$ref": "205" }, "Value": "application/json" } }, { - "$id": "212", + "$id": "207", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "213", + "$id": "208", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1768,9 +1730,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "214", + "$id": "209", "Type": { - "$ref": "213" + "$ref": "208" }, "Value": "application/json" } @@ -1778,7 +1740,7 @@ ], "Responses": [ { - "$id": "215", + "$id": "210", "StatusCodes": [ 200 ], @@ -1805,16 +1767,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "216", + "$id": "211", "Name": "anonymousBody", "ResourceName": "NoDocsTypeSpec", "Description": "body parameter without body decorator", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "217", + "$id": "212", "Name": "Thing", "NameInRequest": "Thing", "Description": "A model with a few properties of literal types", @@ -1832,11 +1794,11 @@ "Kind": "Method" }, { - "$id": "218", + "$id": "213", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "219", + "$id": "214", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1851,19 +1813,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "220", + "$id": "215", "Type": { - "$ref": "219" + "$ref": "214" }, "Value": "application/json" } }, { - "$id": "221", + "$id": "216", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "222", + "$id": "217", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1878,9 +1840,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "223", + "$id": "218", "Type": { - "$ref": "222" + "$ref": "217" }, "Value": "application/json" } @@ -1888,7 +1850,7 @@ ], "Responses": [ { - "$id": "224", + "$id": "219", "StatusCodes": [ 200 ], @@ -1915,16 +1877,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "225", + "$id": "220", "Name": "friendlyModel", "ResourceName": "NoDocsTypeSpec", "Description": "Model can have its friendly name", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "226", + "$id": "221", "Name": "Friend", "NameInRequest": "NotFriend", "Description": "this is not a friendly model but with a friendly name", @@ -1942,11 +1904,11 @@ "Kind": "Method" }, { - "$id": "227", + "$id": "222", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "228", + "$id": "223", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1961,19 +1923,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "229", + "$id": "224", "Type": { - "$ref": "228" + "$ref": "223" }, "Value": "application/json" } }, { - "$id": "230", + "$id": "225", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "231", + "$id": "226", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1988,9 +1950,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "232", + "$id": "227", "Type": { - "$ref": "231" + "$ref": "226" }, "Value": "application/json" } @@ -1998,7 +1960,7 @@ ], "Responses": [ { - "$id": "233", + "$id": "228", "StatusCodes": [ 200 ], @@ -2025,19 +1987,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "234", + "$id": "229", "Name": "addTimeHeader", "ResourceName": "NoDocsTypeSpec", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "235", + "$id": "230", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Type": { - "$id": "236", + "$id": "231", "Kind": "Primitive", "Name": "DateTimeRFC7231", "IsNullable": false @@ -2053,11 +2015,11 @@ "Kind": "Method" }, { - "$id": "237", + "$id": "232", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "238", + "$id": "233", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2072,9 +2034,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "239", + "$id": "234", "Type": { - "$ref": "238" + "$ref": "233" }, "Value": "application/json" } @@ -2082,7 +2044,7 @@ ], "Responses": [ { - "$id": "240", + "$id": "235", "StatusCodes": [ 204 ], @@ -2100,144 +2062,21 @@ "GenerateConvenienceMethod": false }, { - "$id": "241", - "Name": "stringFormat", - "ResourceName": "NoDocsTypeSpec", - "Description": "paramete has string format.", - "Parameters": [ - { - "$ref": "194" - }, - { - "$id": "242", - "Name": "subscriptionId", - "NameInRequest": "subscriptionId", - "Type": { - "$id": "243", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "Location": "Path", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "244", - "Name": "body", - "NameInRequest": "body", - "Type": { - "$ref": "94" - }, - "Location": "Body", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "245", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "246", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": true, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "247", - "Type": { - "$ref": "246" - }, - "Value": "application/json" - } - }, - { - "$id": "248", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "249", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "250", - "Type": { - "$ref": "249" - }, - "Value": "application/json" - } - } - ], - "Responses": [ - { - "$id": "251", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/stringFormat/{subscriptionId}", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true - }, - { - "$id": "252", + "$id": "236", "Name": "projectedNameModel", "ResourceName": "NoDocsTypeSpec", "Description": "Model can have its projected name", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "253", + "$id": "237", "Name": "ProjectedModel", "NameInRequest": "ModelWithProjectedName", "Description": "this is a model with a projected name", "Type": { - "$ref": "99" + "$ref": "94" }, "Location": "Body", "IsRequired": true, @@ -2250,11 +2089,11 @@ "Kind": "Method" }, { - "$id": "254", + "$id": "238", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "255", + "$id": "239", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2269,19 +2108,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "256", + "$id": "240", "Type": { - "$ref": "255" + "$ref": "239" }, "Value": "application/json" } }, { - "$id": "257", + "$id": "241", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "258", + "$id": "242", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2296,9 +2135,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "259", + "$id": "243", "Type": { - "$ref": "258" + "$ref": "242" }, "Value": "application/json" } @@ -2306,12 +2145,12 @@ ], "Responses": [ { - "$id": "260", + "$id": "244", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "99" + "$ref": "94" }, "BodyMediaType": "Json", "Headers": [], @@ -2333,20 +2172,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "261", + "$id": "245", "Name": "returnsAnonymousModel", "ResourceName": "NoDocsTypeSpec", "Description": "return anonymous model", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "262", + "$id": "246", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "263", + "$id": "247", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2361,9 +2200,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "264", + "$id": "248", "Type": { - "$ref": "263" + "$ref": "247" }, "Value": "application/json" } @@ -2371,12 +2210,12 @@ ], "Responses": [ { - "$id": "265", + "$id": "249", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "102" + "$ref": "97" }, "BodyMediaType": "Json", "Headers": [], @@ -2395,20 +2234,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "266", + "$id": "250", "Name": "headAsBoolean", "ResourceName": "NoDocsTypeSpec", "Description": "head as boolean.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "267", + "$id": "251", "Name": "id", "NameInRequest": "id", "Type": { - "$id": "268", + "$id": "252", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2424,11 +2263,11 @@ "Kind": "Method" }, { - "$id": "269", + "$id": "253", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "270", + "$id": "254", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2443,9 +2282,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "271", + "$id": "255", "Type": { - "$ref": "270" + "$ref": "254" }, "Value": "application/json" } @@ -2453,7 +2292,7 @@ ], "Responses": [ { - "$id": "272", + "$id": "256", "StatusCodes": [ 204 ], @@ -2471,20 +2310,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "273", + "$id": "257", "Name": "stringBody", "ResourceName": "NoDocsTypeSpec", "Description": "The body parameter type is string.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "274", + "$id": "258", "Name": "body", "NameInRequest": "body", "Type": { - "$id": "275", + "$id": "259", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2500,11 +2339,11 @@ "Kind": "Method" }, { - "$id": "276", + "$id": "260", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "277", + "$id": "261", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2519,19 +2358,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "278", + "$id": "262", "Type": { - "$ref": "277" + "$ref": "261" }, "Value": "application/json" } }, { - "$id": "279", + "$id": "263", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "280", + "$id": "264", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2546,9 +2385,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "281", + "$id": "265", "Type": { - "$ref": "280" + "$ref": "264" }, "Value": "application/json" } @@ -2556,7 +2395,7 @@ ], "Responses": [ { - "$id": "282", + "$id": "266", "StatusCodes": [ 204 ], @@ -2577,20 +2416,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "283", + "$id": "267", "Name": "boolBody", "ResourceName": "NoDocsTypeSpec", "Description": "The body parameter type is bool.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "284", + "$id": "268", "Name": "body", "NameInRequest": "body", "Type": { - "$id": "285", + "$id": "269", "Kind": "Primitive", "Name": "Boolean", "IsNullable": false @@ -2606,11 +2445,11 @@ "Kind": "Method" }, { - "$id": "286", + "$id": "270", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "287", + "$id": "271", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2625,19 +2464,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "288", + "$id": "272", "Type": { - "$ref": "287" + "$ref": "271" }, "Value": "application/json" } }, { - "$id": "289", + "$id": "273", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "290", + "$id": "274", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2652,9 +2491,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "291", + "$id": "275", "Type": { - "$ref": "290" + "$ref": "274" }, "Value": "application/json" } @@ -2662,7 +2501,7 @@ ], "Responses": [ { - "$id": "292", + "$id": "276", "StatusCodes": [ 204 ], @@ -2683,20 +2522,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "293", + "$id": "277", "Name": "dateTimeBody", "ResourceName": "NoDocsTypeSpec", "Description": "The body parameter type is datetime.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "294", + "$id": "278", "Name": "body", "NameInRequest": "body", "Type": { - "$id": "295", + "$id": "279", "Kind": "Primitive", "Name": "DateTimeRFC3339", "IsNullable": false @@ -2712,11 +2551,11 @@ "Kind": "Method" }, { - "$id": "296", + "$id": "280", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "297", + "$id": "281", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2731,19 +2570,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "298", + "$id": "282", "Type": { - "$ref": "297" + "$ref": "281" }, "Value": "application/json" } }, { - "$id": "299", + "$id": "283", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "300", + "$id": "284", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2758,9 +2597,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "301", + "$id": "285", "Type": { - "$ref": "300" + "$ref": "284" }, "Value": "application/json" } @@ -2768,7 +2607,7 @@ ], "Responses": [ { - "$id": "302", + "$id": "286", "StatusCodes": [ 204 ], @@ -2789,20 +2628,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "303", + "$id": "287", "Name": "returnString", "ResourceName": "NoDocsTypeSpec", "Description": "The return type is datetime.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "304", + "$id": "288", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "305", + "$id": "289", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2817,9 +2656,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "306", + "$id": "290", "Type": { - "$ref": "305" + "$ref": "289" }, "Value": "application/json" } @@ -2827,12 +2666,12 @@ ], "Responses": [ { - "$id": "307", + "$id": "291", "StatusCodes": [ 200 ], "BodyType": { - "$id": "308", + "$id": "292", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2854,19 +2693,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "309", + "$id": "293", "Name": "returnUnknown", "ResourceName": "NoDocsTypeSpec", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "310", + "$id": "294", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "311", + "$id": "295", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2881,9 +2720,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "312", + "$id": "296", "Type": { - "$ref": "311" + "$ref": "295" }, "Value": "application/json" } @@ -2891,12 +2730,12 @@ ], "Responses": [ { - "$id": "313", + "$id": "297", "StatusCodes": [ 200 ], "BodyType": { - "$id": "314", + "$id": "298", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -2918,20 +2757,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "315", + "$id": "299", "Name": "recursiveExtension", "ResourceName": "NoDocsTypeSpec", "Description": "test parent reference child", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "316", + "$id": "300", "Name": "input", "NameInRequest": "input", "Type": { - "$ref": "103" + "$ref": "98" }, "Location": "Body", "IsRequired": true, @@ -2944,11 +2783,11 @@ "Kind": "Method" }, { - "$id": "317", + "$id": "301", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "318", + "$id": "302", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2963,19 +2802,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "319", + "$id": "303", "Type": { - "$ref": "318" + "$ref": "302" }, "Value": "application/json" } }, { - "$id": "320", + "$id": "304", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "321", + "$id": "305", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2990,9 +2829,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "322", + "$id": "306", "Type": { - "$ref": "321" + "$ref": "305" }, "Value": "application/json" } @@ -3000,7 +2839,7 @@ ], "Responses": [ { - "$id": "323", + "$id": "307", "StatusCodes": [ 204 ], @@ -3021,20 +2860,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "324", + "$id": "308", "Name": "threeLevelRecursive", "ResourceName": "NoDocsTypeSpec", "Description": "test three level recursive extension", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "325", + "$id": "309", "Name": "input", "NameInRequest": "input", "Type": { - "$ref": "109" + "$ref": "104" }, "Location": "Body", "IsRequired": true, @@ -3047,11 +2886,11 @@ "Kind": "Method" }, { - "$id": "326", + "$id": "310", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "327", + "$id": "311", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3066,19 +2905,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "328", + "$id": "312", "Type": { - "$ref": "327" + "$ref": "311" }, "Value": "application/json" } }, { - "$id": "329", + "$id": "313", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "330", + "$id": "314", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3093,9 +2932,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "331", + "$id": "315", "Type": { - "$ref": "330" + "$ref": "314" }, "Value": "application/json" } @@ -3103,7 +2942,7 @@ ], "Responses": [ { - "$id": "332", + "$id": "316", "StatusCodes": [ 204 ], @@ -3124,20 +2963,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "333", + "$id": "317", "Name": "recursiveModels", "ResourceName": "NoDocsTypeSpec", "Description": "test child reference parent", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "334", + "$id": "318", "Name": "input", "NameInRequest": "input", "Type": { - "$ref": "118" + "$ref": "113" }, "Location": "Body", "IsRequired": true, @@ -3150,11 +2989,11 @@ "Kind": "Method" }, { - "$id": "335", + "$id": "319", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "336", + "$id": "320", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3169,19 +3008,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "337", + "$id": "321", "Type": { - "$ref": "336" + "$ref": "320" }, "Value": "application/json" } }, { - "$id": "338", + "$id": "322", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "339", + "$id": "323", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3196,9 +3035,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "340", + "$id": "324", "Type": { - "$ref": "339" + "$ref": "323" }, "Value": "application/json" } @@ -3206,7 +3045,7 @@ ], "Responses": [ { - "$id": "341", + "$id": "325", "StatusCodes": [ 204 ], @@ -3227,20 +3066,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "342", + "$id": "326", "Name": "ContainSelfModels", "ResourceName": "NoDocsTypeSpec", "Description": "test contain self models", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "343", + "$id": "327", "Name": "input", "NameInRequest": "input", "Type": { - "$ref": "124" + "$ref": "119" }, "Location": "Body", "IsRequired": true, @@ -3253,11 +3092,11 @@ "Kind": "Method" }, { - "$id": "344", + "$id": "328", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "345", + "$id": "329", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3272,19 +3111,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "346", + "$id": "330", "Type": { - "$ref": "345" + "$ref": "329" }, "Value": "application/json" } }, { - "$id": "347", + "$id": "331", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "348", + "$id": "332", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3299,9 +3138,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "349", + "$id": "333", "Type": { - "$ref": "348" + "$ref": "332" }, "Value": "application/json" } @@ -3309,7 +3148,7 @@ ], "Responses": [ { - "$id": "350", + "$id": "334", "StatusCodes": [ 204 ], @@ -3330,16 +3169,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "351", + "$id": "335", "Name": "enumParameter", "ResourceName": "NoDocsTypeSpec", "Description": "test enum parameter.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "352", + "$id": "336", "Name": "p1", "NameInRequest": "p1", "Type": { @@ -3356,11 +3195,11 @@ "Kind": "Method" }, { - "$id": "353", + "$id": "337", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "354", + "$id": "338", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3375,9 +3214,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "355", + "$id": "339", "Type": { - "$ref": "354" + "$ref": "338" }, "Value": "application/json" } @@ -3385,7 +3224,7 @@ ], "Responses": [ { - "$id": "356", + "$id": "340", "StatusCodes": [ 204 ], @@ -3403,20 +3242,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "357", + "$id": "341", "Name": "bodyIsModelWithProjectedEnum", "ResourceName": "NoDocsTypeSpec", "Description": "test enum parameter.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "358", + "$id": "342", "Name": "body", "NameInRequest": "body", "Type": { - "$ref": "126" + "$ref": "121" }, "Location": "Body", "IsRequired": true, @@ -3429,11 +3268,11 @@ "Kind": "Method" }, { - "$id": "359", + "$id": "343", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "360", + "$id": "344", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3448,19 +3287,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "361", + "$id": "345", "Type": { - "$ref": "360" + "$ref": "344" }, "Value": "application/json" } }, { - "$id": "362", + "$id": "346", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "363", + "$id": "347", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3475,9 +3314,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "364", + "$id": "348", "Type": { - "$ref": "363" + "$ref": "347" }, "Value": "application/json" } @@ -3485,7 +3324,7 @@ ], "Responses": [ { - "$id": "365", + "$id": "349", "StatusCodes": [ 204 ], @@ -3506,30 +3345,30 @@ "GenerateConvenienceMethod": true }, { - "$id": "366", + "$id": "350", "Name": "optionalDictionary", "ResourceName": "NoDocsTypeSpec", "Description": "test optional dictionary.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "367", + "$id": "351", "Name": "body", "NameInRequest": "body", "Type": { - "$id": "368", + "$id": "352", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "369", + "$id": "353", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "370", + "$id": "354", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -3547,11 +3386,11 @@ "Kind": "Method" }, { - "$id": "371", + "$id": "355", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "372", + "$id": "356", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3566,19 +3405,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "373", + "$id": "357", "Type": { - "$ref": "372" + "$ref": "356" }, "Value": "application/json" } }, { - "$id": "374", + "$id": "358", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "375", + "$id": "359", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3593,9 +3432,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "376", + "$id": "360", "Type": { - "$ref": "375" + "$ref": "359" }, "Value": "application/json" } @@ -3603,7 +3442,7 @@ ], "Responses": [ { - "$id": "377", + "$id": "361", "StatusCodes": [ 204 ], @@ -3624,20 +3463,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "378", + "$id": "362", "Name": "azureLocationOp", "ResourceName": "NoDocsTypeSpec", "Description": "test optional dictionary.", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "379", + "$id": "363", "Name": "location", "NameInRequest": "location", "Type": { - "$id": "380", + "$id": "364", "Kind": "Primitive", "Name": "AzureLocation", "IsNullable": false @@ -3653,11 +3492,11 @@ "Kind": "Method" }, { - "$id": "381", + "$id": "365", "Name": "regenLocation", "NameInRequest": "regen-location", "Type": { - "$id": "382", + "$id": "366", "Kind": "Primitive", "Name": "AzureLocation", "IsNullable": false @@ -3673,11 +3512,11 @@ "Kind": "Method" }, { - "$id": "383", + "$id": "367", "Name": "body", "NameInRequest": "body", "Type": { - "$ref": "128" + "$ref": "123" }, "Location": "Body", "IsRequired": false, @@ -3690,11 +3529,11 @@ "Kind": "Method" }, { - "$id": "384", + "$id": "368", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "385", + "$id": "369", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3709,19 +3548,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "386", + "$id": "370", "Type": { - "$ref": "385" + "$ref": "369" }, "Value": "application/json" } }, { - "$id": "387", + "$id": "371", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "388", + "$id": "372", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3736,9 +3575,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "389", + "$id": "373", "Type": { - "$ref": "388" + "$ref": "372" }, "Value": "application/json" } @@ -3746,7 +3585,7 @@ ], "Responses": [ { - "$id": "390", + "$id": "374", "StatusCodes": [ 204 ], @@ -3768,41 +3607,41 @@ } ], "Protocol": { - "$id": "391" + "$id": "375" }, "Creatable": true }, { - "$id": "392", + "$id": "376", "Name": "Hello", "Description": "", "Operations": [], "Protocol": { - "$id": "393" + "$id": "377" }, "Creatable": false, "Parent": "NoDocsTypeSpecClient" }, { - "$id": "394", + "$id": "378", "Name": "HelloDemo", "Description": "Hello world service", "Operations": [ { - "$id": "395", + "$id": "379", "Name": "sayHi", "ResourceName": "Demo", "Description": "Return hi", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "396", + "$id": "380", "Name": "headParameter", "NameInRequest": "head-parameter", "Type": { - "$id": "397", + "$id": "381", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3818,11 +3657,11 @@ "Kind": "Method" }, { - "$id": "398", + "$id": "382", "Name": "queryParameter", "NameInRequest": "queryParameter", "Type": { - "$id": "399", + "$id": "383", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3838,11 +3677,11 @@ "Kind": "Method" }, { - "$id": "400", + "$id": "384", "Name": "optionalQuery", "NameInRequest": "optionalQuery", "Type": { - "$id": "401", + "$id": "385", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3858,11 +3697,11 @@ "Kind": "Method" }, { - "$id": "402", + "$id": "386", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "403", + "$id": "387", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3877,9 +3716,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "404", + "$id": "388", "Type": { - "$ref": "403" + "$ref": "387" }, "Value": "application/json" } @@ -3887,7 +3726,7 @@ ], "Responses": [ { - "$id": "405", + "$id": "389", "StatusCodes": [ 200 ], @@ -3912,31 +3751,31 @@ } ], "Protocol": { - "$id": "406" + "$id": "390" }, "Creatable": false, "Parent": "Hello" }, { - "$id": "407", + "$id": "391", "Name": "HelloDemo2", "Description": "", "Operations": [ { - "$id": "408", + "$id": "392", "Name": "helloAgain", "ResourceName": "Demo2", "Description": "Return hi again", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "409", + "$id": "393", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "410", + "$id": "394", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3952,15 +3791,15 @@ "Kind": "Method" }, { - "$id": "411", + "$id": "395", "Name": "contentType", "NameInRequest": "content-type", "Type": { - "$id": "412", + "$id": "396", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "413", + "$id": "397", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3970,9 +3809,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "414", + "$id": "398", "Type": { - "$ref": "412" + "$ref": "396" }, "Value": "text/plain" }, @@ -3986,11 +3825,11 @@ "Kind": "Constant" }, { - "$id": "415", + "$id": "399", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "416", + "$id": "400", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4006,11 +3845,11 @@ "Kind": "Method" }, { - "$id": "417", + "$id": "401", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "131" + "$ref": "126" }, "Location": "Body", "IsRequired": true, @@ -4023,11 +3862,11 @@ "Kind": "Method" }, { - "$id": "418", + "$id": "402", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "419", + "$id": "403", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4042,9 +3881,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "420", + "$id": "404", "Type": { - "$ref": "419" + "$ref": "403" }, "Value": "application/json" } @@ -4052,12 +3891,12 @@ ], "Responses": [ { - "$id": "421", + "$id": "405", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "131" + "$ref": "126" }, "BodyMediaType": "Json", "Headers": [], @@ -4079,20 +3918,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "422", + "$id": "406", "Name": "noContentType", "ResourceName": "Demo2", "Description": "Return hi again", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "423", + "$id": "407", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "424", + "$id": "408", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4108,11 +3947,11 @@ "Kind": "Method" }, { - "$id": "425", + "$id": "409", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "426", + "$id": "410", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4128,11 +3967,11 @@ "Kind": "Method" }, { - "$id": "427", + "$id": "411", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "131" + "$ref": "126" }, "Location": "Body", "IsRequired": true, @@ -4145,11 +3984,11 @@ "Kind": "Method" }, { - "$id": "428", + "$id": "412", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "429", + "$id": "413", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4164,19 +4003,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "430", + "$id": "414", "Type": { - "$ref": "429" + "$ref": "413" }, "Value": "application/json" } }, { - "$id": "431", + "$id": "415", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "432", + "$id": "416", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4191,9 +4030,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "433", + "$id": "417", "Type": { - "$ref": "432" + "$ref": "416" }, "Value": "application/json" } @@ -4201,12 +4040,12 @@ ], "Responses": [ { - "$id": "434", + "$id": "418", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "131" + "$ref": "126" }, "BodyMediaType": "Json", "Headers": [], @@ -4228,20 +4067,20 @@ "GenerateConvenienceMethod": false }, { - "$id": "435", + "$id": "419", "Name": "helloDemoAgain", "ResourceName": "Demo2", "Description": "Return hi in demo2", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "436", + "$id": "420", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "437", + "$id": "421", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4256,9 +4095,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "438", + "$id": "422", "Type": { - "$ref": "437" + "$ref": "421" }, "Value": "application/json" } @@ -4266,7 +4105,7 @@ ], "Responses": [ { - "$id": "439", + "$id": "423", "StatusCodes": [ 200 ], @@ -4290,16 +4129,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "440", + "$id": "424", "Name": "createLiteral", "ResourceName": "Demo2", "Description": "Create with literal value", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "441", + "$id": "425", "Name": "body", "NameInRequest": "body", "Type": { @@ -4316,11 +4155,11 @@ "Kind": "Method" }, { - "$id": "442", + "$id": "426", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "443", + "$id": "427", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4335,19 +4174,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "444", + "$id": "428", "Type": { - "$ref": "443" + "$ref": "427" }, "Value": "application/json" } }, { - "$id": "445", + "$id": "429", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "446", + "$id": "430", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4362,9 +4201,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "447", + "$id": "431", "Type": { - "$ref": "446" + "$ref": "430" }, "Value": "application/json" } @@ -4372,7 +4211,7 @@ ], "Responses": [ { - "$id": "448", + "$id": "432", "StatusCodes": [ 200 ], @@ -4399,24 +4238,24 @@ "GenerateConvenienceMethod": true }, { - "$id": "449", + "$id": "433", "Name": "helloLiteral", "ResourceName": "Demo2", "Description": "Send literal parameters", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "450", + "$id": "434", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "451", + "$id": "435", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "452", + "$id": "436", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4426,9 +4265,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "453", + "$id": "437", "Type": { - "$ref": "451" + "$ref": "435" }, "Value": "test" }, @@ -4442,15 +4281,15 @@ "Kind": "Constant" }, { - "$id": "454", + "$id": "438", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "455", + "$id": "439", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "456", + "$id": "440", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -4460,9 +4299,9 @@ }, "Location": "Path", "DefaultValue": { - "$id": "457", + "$id": "441", "Type": { - "$ref": "455" + "$ref": "439" }, "Value": 123 }, @@ -4476,15 +4315,15 @@ "Kind": "Constant" }, { - "$id": "458", + "$id": "442", "Name": "p3", "NameInRequest": "p3", "Type": { - "$id": "459", + "$id": "443", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "460", + "$id": "444", "Kind": "Primitive", "Name": "Boolean", "IsNullable": false @@ -4494,9 +4333,9 @@ }, "Location": "Query", "DefaultValue": { - "$id": "461", + "$id": "445", "Type": { - "$ref": "459" + "$ref": "443" }, "Value": true }, @@ -4510,11 +4349,11 @@ "Kind": "Constant" }, { - "$id": "462", + "$id": "446", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "463", + "$id": "447", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4529,9 +4368,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "464", + "$id": "448", "Type": { - "$ref": "463" + "$ref": "447" }, "Value": "application/json" } @@ -4539,7 +4378,7 @@ ], "Responses": [ { - "$id": "465", + "$id": "449", "StatusCodes": [ 200 ], @@ -4564,27 +4403,27 @@ } ], "Protocol": { - "$id": "466" + "$id": "450" }, "Creatable": false, "Parent": "Hello" }, { - "$id": "467", + "$id": "451", "Name": "EnumTest", "Description": "", "Operations": [ { - "$id": "468", + "$id": "452", "Name": "createUnknownValue", "ResourceName": "EnumTest", "Description": "get extensible enum", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "469", + "$id": "453", "Name": "input", "NameInRequest": "input", "Type": { @@ -4601,11 +4440,11 @@ "Kind": "Method" }, { - "$id": "470", + "$id": "454", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "471", + "$id": "455", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4620,19 +4459,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "472", + "$id": "456", "Type": { - "$ref": "471" + "$ref": "455" }, "Value": "application/json" } }, { - "$id": "473", + "$id": "457", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "474", + "$id": "458", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4647,9 +4486,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "475", + "$id": "459", "Type": { - "$ref": "474" + "$ref": "458" }, "Value": "application/json" } @@ -4657,7 +4496,7 @@ ], "Responses": [ { - "$id": "476", + "$id": "460", "StatusCodes": [ 204 ], @@ -4679,27 +4518,27 @@ } ], "Protocol": { - "$id": "477" + "$id": "461" }, "Creatable": false, "Parent": "NoDocsTypeSpecClient" }, { - "$id": "478", + "$id": "462", "Name": "ProtocolAndConvenient", "Description": "", "Operations": [ { - "$id": "479", + "$id": "463", "Name": "internalProtocol", "ResourceName": "ProtocolAndConvenient", "Description": "When set protocol false and convenient true, then the protocol method should be internal", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "480", + "$id": "464", "Name": "body", "NameInRequest": "body", "Type": { @@ -4716,11 +4555,11 @@ "Kind": "Method" }, { - "$id": "481", + "$id": "465", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "482", + "$id": "466", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4735,19 +4574,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "483", + "$id": "467", "Type": { - "$ref": "482" + "$ref": "466" }, "Value": "application/json" } }, { - "$id": "484", + "$id": "468", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "485", + "$id": "469", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4762,9 +4601,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "486", + "$id": "470", "Type": { - "$ref": "485" + "$ref": "469" }, "Value": "application/json" } @@ -4772,7 +4611,7 @@ ], "Responses": [ { - "$id": "487", + "$id": "471", "StatusCodes": [ 200 ], @@ -4799,20 +4638,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "488", + "$id": "472", "Name": "stillConvenient", "ResourceName": "ProtocolAndConvenient", "Description": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "489", + "$id": "473", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "490", + "$id": "474", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4827,9 +4666,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "491", + "$id": "475", "Type": { - "$ref": "490" + "$ref": "474" }, "Value": "application/json" } @@ -4837,7 +4676,7 @@ ], "Responses": [ { - "$id": "492", + "$id": "476", "StatusCodes": [ 204 ], @@ -4856,31 +4695,31 @@ } ], "Protocol": { - "$id": "493" + "$id": "477" }, "Creatable": false, "Parent": "NoDocsTypeSpecClient" }, { - "$id": "494", + "$id": "478", "Name": "Entity", "Description": "", "Operations": [ { - "$id": "495", + "$id": "479", "Name": "doSomething", "ResourceName": "Entity", "Description": "doSomething for entity", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "496", + "$id": "480", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "497", + "$id": "481", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4896,11 +4735,11 @@ "Kind": "Method" }, { - "$id": "498", + "$id": "482", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "499", + "$id": "483", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4915,9 +4754,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "500", + "$id": "484", "Type": { - "$ref": "499" + "$ref": "483" }, "Value": "application/json" } @@ -4925,7 +4764,7 @@ ], "Responses": [ { - "$id": "501", + "$id": "485", "StatusCodes": [ 200 ], @@ -4950,31 +4789,31 @@ } ], "Protocol": { - "$id": "502" + "$id": "486" }, "Creatable": false, "Parent": "NoDocsTypeSpecClient" }, { - "$id": "503", + "$id": "487", "Name": "Glossary", "Description": "", "Operations": [ { - "$id": "504", + "$id": "488", "Name": "doSomething", "ResourceName": "Glossary", "Description": "doSomething for glossary", "Parameters": [ { - "$ref": "194" + "$ref": "189" }, { - "$id": "505", + "$id": "489", "Name": "id", "NameInRequest": "id", "Type": { - "$id": "506", + "$id": "490", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -4990,11 +4829,11 @@ "Kind": "Method" }, { - "$id": "507", + "$id": "491", "Name": "h1", "NameInRequest": "h1", "Type": { - "$id": "508", + "$id": "492", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -5010,11 +4849,11 @@ "Kind": "Method" }, { - "$id": "509", + "$id": "493", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "510", + "$id": "494", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -5029,9 +4868,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "511", + "$id": "495", "Type": { - "$ref": "510" + "$ref": "494" }, "Value": "application/json" } @@ -5039,7 +4878,7 @@ ], "Responses": [ { - "$id": "512", + "$id": "496", "StatusCodes": [ 200 ], @@ -5064,20 +4903,20 @@ } ], "Protocol": { - "$id": "513" + "$id": "497" }, "Creatable": false, "Parent": "NoDocsTypeSpecClient" } ], "Auth": { - "$id": "514", + "$id": "498", "ApiKey": { - "$id": "515", + "$id": "499", "Name": "x-ms-api-key" }, "OAuth2": { - "$id": "516", + "$id": "500", "Scopes": [ "https://api.example.com/.default" ] diff --git a/test/TestProjects/NoDocs-TypeSpec/tests/Generated/Tests/NoDocsTypeSpecClientTests.cs b/test/TestProjects/NoDocs-TypeSpec/tests/Generated/Tests/NoDocsTypeSpecClientTests.cs index ba486db59d3..289dce47bc4 100644 --- a/test/TestProjects/NoDocs-TypeSpec/tests/Generated/Tests/NoDocsTypeSpecClientTests.cs +++ b/test/TestProjects/NoDocs-TypeSpec/tests/Generated/Tests/NoDocsTypeSpecClientTests.cs @@ -30,7 +30,7 @@ public async Task NoDocsTypeSpec_TopAction_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); } [Test] @@ -41,7 +41,7 @@ public async Task NoDocsTypeSpec_TopAction_ShortVersion_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -52,7 +52,7 @@ public async Task NoDocsTypeSpec_TopAction_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); } [Test] @@ -63,7 +63,7 @@ public async Task NoDocsTypeSpec_TopAction_AllParameters_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -311,62 +311,6 @@ public async Task NoDocsTypeSpec_AddTimeHeader_AllParameters() Response response = await client.AddTimeHeaderAsync(); } - [Test] - [Ignore("Please remove the Ignore attribute to let the test method run")] - public async Task NoDocsTypeSpec_StringFormat_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - } - - [Test] - [Ignore("Please remove the Ignore attribute to let the test method run")] - public async Task NoDocsTypeSpec_StringFormat_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } - - [Test] - [Ignore("Please remove the Ignore attribute to let the test method run")] - public async Task NoDocsTypeSpec_StringFormat_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - } - - [Test] - [Ignore("Please remove the Ignore attribute to let the test method run")] - public async Task NoDocsTypeSpec_StringFormat_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NoDocsTypeSpecClient client = CreateNoDocsTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } - [Test] [Ignore("Please remove the Ignore attribute to let the test method run")] public async Task NoDocsTypeSpec_ProjectedNameModel_ShortVersion() diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/Azure.NewProject.TypeSpec.tsp b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/Azure.NewProject.TypeSpec.tsp index e6af453a44b..b96ec923e2e 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/Azure.NewProject.TypeSpec.tsp +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/Azure.NewProject.TypeSpec.tsp @@ -196,16 +196,6 @@ union DaysOfWeekExtensibleEnum { Sunday: "Sunday", } -model ModelWithFormat { - @doc("url format") - @format("uri") - sourceUrl: string; - - @doc("uuid format") - @format("uuid") - guid: string; -} - @doc("Hello world service") @route("/hello") namespace Hello.Demo { @@ -257,7 +247,7 @@ namespace Hello.Demo2 { @doc("top level method") @get @convenientAPI(true) -op topAction(@path @format("date") action: string): Thing; +op topAction(@path action: utcDateTime): Thing; @route("/top2") @doc("top level method2") @@ -287,12 +277,6 @@ op addTimeHeader( @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime ): void; -@route("/stringFormat") -@doc("paramete has string format.") -@post -@convenientAPI(true) -op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void; - // TODO: https://github.com/Azure/typespec-azure/issues/509 namespace EnumTest { @put diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml index e00905921b3..d405823bcdf 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml @@ -9,7 +9,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> This sample shows how to call TopActionAsync with all parameters. "); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> @@ -28,7 +28,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> This sample shows how to call TopAction with all parameters. "); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); ]]> @@ -47,7 +47,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -64,7 +64,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -88,7 +88,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -105,7 +105,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); +Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -668,114 +668,6 @@ NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credent Response response = client.AddTimeHeader(); -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call StringFormatAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); -]]> -This sample shows how to call StringFormatAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); -]]> - - - -This sample shows how to call StringFormat. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); -]]> -This sample shows how to call StringFormat with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); -]]> - - - -This sample shows how to call StringFormatAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", -}); -Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call StringFormatAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", -}); -Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call StringFormat. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", -}); -Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call StringFormat with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", -}); -Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - Console.WriteLine(response.Status); ]]> diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs deleted file mode 100644 index 38725d38961..00000000000 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.NewProject.TypeSpec.Models -{ - public partial class ModelWithFormat : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("sourceUrl"u8); - writer.WriteStringValue(SourceUrl.AbsoluteUri); - writer.WritePropertyName("guid"u8); - writer.WriteStringValue(Guid); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelWithFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelWithFormat(document.RootElement, options); - } - - internal static ModelWithFormat DeserializeModelWithFormat(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri sourceUrl = default; - Guid guid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceUrl"u8)) - { - sourceUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("guid"u8)) - { - guid = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelWithFormat(sourceUrl, guid, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{options.Format}' format."); - } - } - - ModelWithFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelWithFormat(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ModelWithFormat FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeModelWithFormat(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.cs deleted file mode 100644 index 331de497657..00000000000 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Models/ModelWithFormat.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.NewProject.TypeSpec.Models -{ - /// The ModelWithFormat. - public partial class ModelWithFormat - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// url format. - /// uuid format. - /// is null. - public ModelWithFormat(Uri sourceUrl, Guid guid) - { - Argument.AssertNotNull(sourceUrl, nameof(sourceUrl)); - - SourceUrl = sourceUrl; - Guid = guid; - } - - /// Initializes a new instance of . - /// url format. - /// uuid format. - /// Keeps track of any properties unknown to the library. - internal ModelWithFormat(Uri sourceUrl, Guid guid, IDictionary serializedAdditionalRawData) - { - SourceUrl = sourceUrl; - Guid = guid; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelWithFormat() - { - } - - /// url format. - public Uri SourceUrl { get; } - /// uuid format. - public Guid Guid { get; } - } -} diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs index 428de6bc732..4d5c37613a2 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs @@ -584,118 +584,6 @@ public virtual Response AddTimeHeader(RequestContext context = null) } } - /// paramete has string format. - /// The to use. - /// The to use. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task StringFormatAsync(Guid subscriptionId, ModelWithFormat body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await StringFormatAsync(subscriptionId, content, context).ConfigureAwait(false); - return response; - } - - /// paramete has string format. - /// The to use. - /// The to use. - /// The cancellation token to use. - /// is null. - /// - public virtual Response StringFormat(Guid subscriptionId, ModelWithFormat body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = StringFormat(subscriptionId, content, context); - return response; - } - - /// - /// [Protocol Method] paramete has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task StringFormatAsync(Guid subscriptionId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("NewProjectTypeSpecClient.StringFormat"); - scope.Start(); - try - { - using HttpMessage message = CreateStringFormatRequest(subscriptionId, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] paramete has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response StringFormat(Guid subscriptionId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("NewProjectTypeSpecClient.StringFormat"); - scope.Start(); - try - { - using HttpMessage message = CreateStringFormatRequest(subscriptionId, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - private Hello _cachedHello; private EnumTest _cachedEnumTest; private ProtocolAndConvenient _cachedProtocolAndConvenient; @@ -804,22 +692,6 @@ internal HttpMessage CreateAddTimeHeaderRequest(RequestContext context) return message; } - internal HttpMessage CreateStringFormatRequest(Guid subscriptionId, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/stringFormat/", false); - uri.AppendPath(subscriptionId, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - private static RequestContext DefaultRequestContext = new RequestContext(); internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) { diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/tspCodeModel.json b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/tspCodeModel.json index ca87abad476..3a9c779c12a 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/tspCodeModel.json +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/tspCodeModel.json @@ -592,44 +592,6 @@ { "$id": "78", "Kind": "Model", - "Name": "ModelWithFormat", - "Namespace": "NewProjectTypeSpec", - "IsNullable": false, - "Usage": "Input", - "Properties": [ - { - "$id": "79", - "Name": "sourceUrl", - "SerializedName": "sourceUrl", - "Description": "url format", - "Type": { - "$id": "80", - "Kind": "Primitive", - "Name": "Uri", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - }, - { - "$id": "81", - "Name": "guid", - "SerializedName": "guid", - "Description": "uuid format", - "Type": { - "$id": "82", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - } - ] - }, - { - "$id": "83", - "Kind": "Model", "Name": "RoundTripModel", "Namespace": "NewProjectTypeSpec", "Description": "this is a roundtrip model", @@ -637,12 +599,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "84", + "$id": "79", "Name": "requiredString", "SerializedName": "requiredString", "Description": "Required string, illustrating a reference type property.", "Type": { - "$id": "85", + "$id": "80", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -651,12 +613,12 @@ "IsReadOnly": false }, { - "$id": "86", + "$id": "81", "Name": "requiredInt", "SerializedName": "requiredInt", "Description": "Required int, illustrating a value type property.", "Type": { - "$id": "87", + "$id": "82", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -665,12 +627,12 @@ "IsReadOnly": false }, { - "$id": "88", + "$id": "83", "Name": "requiredCollection", "SerializedName": "requiredCollection", "Description": "Required collection of enums", "Type": { - "$id": "89", + "$id": "84", "Kind": "Array", "Name": "Array", "ElementType": { @@ -682,16 +644,16 @@ "IsReadOnly": false }, { - "$id": "90", + "$id": "85", "Name": "requiredDictionary", "SerializedName": "requiredDictionary", "Description": "Required dictionary of enums", "Type": { - "$id": "91", + "$id": "86", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "92", + "$id": "87", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -705,7 +667,7 @@ "IsReadOnly": false }, { - "$id": "93", + "$id": "88", "Name": "requiredModel", "SerializedName": "requiredModel", "Description": "Required model", @@ -716,7 +678,7 @@ "IsReadOnly": false }, { - "$id": "94", + "$id": "89", "Name": "intExtensibleEnum", "SerializedName": "intExtensibleEnum", "Description": "this is an int based extensible enum", @@ -727,12 +689,12 @@ "IsReadOnly": false }, { - "$id": "95", + "$id": "90", "Name": "intExtensibleEnumCollection", "SerializedName": "intExtensibleEnumCollection", "Description": "this is a collection of int based extensible enum", "Type": { - "$id": "96", + "$id": "91", "Kind": "Array", "Name": "Array", "ElementType": { @@ -744,7 +706,7 @@ "IsReadOnly": false }, { - "$id": "97", + "$id": "92", "Name": "floatExtensibleEnum", "SerializedName": "floatExtensibleEnum", "Description": "this is a float based extensible enum", @@ -755,12 +717,12 @@ "IsReadOnly": false }, { - "$id": "98", + "$id": "93", "Name": "floatExtensibleEnumCollection", "SerializedName": "floatExtensibleEnumCollection", "Description": "this is a collection of float based extensible enum", "Type": { - "$id": "99", + "$id": "94", "Kind": "Array", "Name": "Array", "ElementType": { @@ -772,7 +734,7 @@ "IsReadOnly": false }, { - "$id": "100", + "$id": "95", "Name": "floatFixedEnum", "SerializedName": "floatFixedEnum", "Description": "this is a float based fixed enum", @@ -783,12 +745,12 @@ "IsReadOnly": false }, { - "$id": "101", + "$id": "96", "Name": "floatFixedEnumCollection", "SerializedName": "floatFixedEnumCollection", "Description": "this is a collection of float based fixed enum", "Type": { - "$id": "102", + "$id": "97", "Kind": "Array", "Name": "Array", "ElementType": { @@ -800,7 +762,7 @@ "IsReadOnly": false }, { - "$id": "103", + "$id": "98", "Name": "intFixedEnum", "SerializedName": "intFixedEnum", "Description": "this is a int based fixed enum", @@ -811,12 +773,12 @@ "IsReadOnly": false }, { - "$id": "104", + "$id": "99", "Name": "intFixedEnumCollection", "SerializedName": "intFixedEnumCollection", "Description": "this is a collection of int based fixed enum", "Type": { - "$id": "105", + "$id": "100", "Kind": "Array", "Name": "Array", "ElementType": { @@ -828,7 +790,7 @@ "IsReadOnly": false }, { - "$id": "106", + "$id": "101", "Name": "stringFixedEnum", "SerializedName": "stringFixedEnum", "Description": "this is a string based fixed enum", @@ -839,12 +801,12 @@ "IsReadOnly": false }, { - "$id": "107", + "$id": "102", "Name": "requiredUnknown", "SerializedName": "requiredUnknown", "Description": "required unknown", "Type": { - "$id": "108", + "$id": "103", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -853,12 +815,12 @@ "IsReadOnly": false }, { - "$id": "109", + "$id": "104", "Name": "optionalUnknown", "SerializedName": "optionalUnknown", "Description": "optional unknown", "Type": { - "$id": "110", + "$id": "105", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -867,22 +829,22 @@ "IsReadOnly": false }, { - "$id": "111", + "$id": "106", "Name": "requiredRecordUnknown", "SerializedName": "requiredRecordUnknown", "Description": "required record of unknown", "Type": { - "$id": "112", + "$id": "107", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "113", + "$id": "108", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "114", + "$id": "109", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -893,22 +855,22 @@ "IsReadOnly": false }, { - "$id": "115", + "$id": "110", "Name": "optionalRecordUnknown", "SerializedName": "optionalRecordUnknown", "Description": "optional record of unknown", "Type": { - "$id": "116", + "$id": "111", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "117", + "$id": "112", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "118", + "$id": "113", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -919,22 +881,22 @@ "IsReadOnly": false }, { - "$id": "119", + "$id": "114", "Name": "readOnlyRequiredRecordUnknown", "SerializedName": "readOnlyRequiredRecordUnknown", "Description": "required readonly record of unknown", "Type": { - "$id": "120", + "$id": "115", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "121", + "$id": "116", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "122", + "$id": "117", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -945,22 +907,22 @@ "IsReadOnly": true }, { - "$id": "123", + "$id": "118", "Name": "readOnlyOptionalRecordUnknown", "SerializedName": "readOnlyOptionalRecordUnknown", "Description": "optional readonly record of unknown", "Type": { - "$id": "124", + "$id": "119", "Kind": "Dictionary", "Name": "Dictionary", "KeyType": { - "$id": "125", + "$id": "120", "Kind": "Primitive", "Name": "String", "IsNullable": false }, "ValueType": { - "$id": "126", + "$id": "121", "Kind": "Intrinsic", "Name": "unknown", "IsNullable": false @@ -975,22 +937,22 @@ ], "Clients": [ { - "$id": "127", + "$id": "122", "Name": "NewProjectTypeSpecClient", "Description": "This is a sample typespec project.", "Operations": [ { - "$id": "128", + "$id": "123", "Name": "topAction", "ResourceName": "NewProjectTypeSpec", "Description": "top level method", "Parameters": [ { - "$id": "129", + "$id": "124", "Name": "firstTestTypeSpecUrl", "NameInRequest": "firstTestTypeSpecUrl", "Type": { - "$id": "130", + "$id": "125", "Kind": "Primitive", "Name": "Uri", "IsNullable": false @@ -1006,13 +968,13 @@ "Kind": "Client" }, { - "$id": "131", + "$id": "126", "Name": "action", "NameInRequest": "action", "Type": { - "$id": "132", + "$id": "127", "Kind": "Primitive", - "Name": "DateTime", + "Name": "DateTimeRFC3339", "IsNullable": false }, "Location": "Path", @@ -1026,11 +988,11 @@ "Kind": "Method" }, { - "$id": "133", + "$id": "128", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "134", + "$id": "129", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1045,9 +1007,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "135", + "$id": "130", "Type": { - "$ref": "134" + "$ref": "129" }, "Value": "application/json" } @@ -1055,7 +1017,7 @@ ], "Responses": [ { - "$id": "136", + "$id": "131", "StatusCodes": [ 200 ], @@ -1079,20 +1041,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "137", + "$id": "132", "Name": "topAction2", "ResourceName": "NewProjectTypeSpec", "Description": "top level method2", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "138", + "$id": "133", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "139", + "$id": "134", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1107,9 +1069,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "140", + "$id": "135", "Type": { - "$ref": "139" + "$ref": "134" }, "Value": "application/json" } @@ -1117,7 +1079,7 @@ ], "Responses": [ { - "$id": "141", + "$id": "136", "StatusCodes": [ 200 ], @@ -1141,16 +1103,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "142", + "$id": "137", "Name": "patchAction", "ResourceName": "NewProjectTypeSpec", "Description": "top level patch", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "143", + "$id": "138", "Name": "body", "NameInRequest": "body", "Type": { @@ -1167,11 +1129,11 @@ "Kind": "Method" }, { - "$id": "144", + "$id": "139", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "145", + "$id": "140", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1186,19 +1148,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "146", + "$id": "141", "Type": { - "$ref": "145" + "$ref": "140" }, "Value": "application/json" } }, { - "$id": "147", + "$id": "142", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "148", + "$id": "143", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1213,9 +1175,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "149", + "$id": "144", "Type": { - "$ref": "148" + "$ref": "143" }, "Value": "application/json" } @@ -1223,7 +1185,7 @@ ], "Responses": [ { - "$id": "150", + "$id": "145", "StatusCodes": [ 200 ], @@ -1250,16 +1212,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "151", + "$id": "146", "Name": "anonymousBody", "ResourceName": "NewProjectTypeSpec", "Description": "body parameter without body decorator", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "152", + "$id": "147", "Name": "Thing", "NameInRequest": "Thing", "Description": "A model with a few properties of literal types", @@ -1277,11 +1239,11 @@ "Kind": "Method" }, { - "$id": "153", + "$id": "148", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "154", + "$id": "149", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1296,19 +1258,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "155", + "$id": "150", "Type": { - "$ref": "154" + "$ref": "149" }, "Value": "application/json" } }, { - "$id": "156", + "$id": "151", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "157", + "$id": "152", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1323,9 +1285,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "158", + "$id": "153", "Type": { - "$ref": "157" + "$ref": "152" }, "Value": "application/json" } @@ -1333,7 +1295,7 @@ ], "Responses": [ { - "$id": "159", + "$id": "154", "StatusCodes": [ 200 ], @@ -1360,16 +1322,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "160", + "$id": "155", "Name": "friendlyModel", "ResourceName": "NewProjectTypeSpec", "Description": "Model can have its friendly name", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "161", + "$id": "156", "Name": "Friend", "NameInRequest": "NotFriend", "Description": "this is not a friendly model but with a friendly name", @@ -1387,11 +1349,11 @@ "Kind": "Method" }, { - "$id": "162", + "$id": "157", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "163", + "$id": "158", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1406,19 +1368,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "164", + "$id": "159", "Type": { - "$ref": "163" + "$ref": "158" }, "Value": "application/json" } }, { - "$id": "165", + "$id": "160", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "166", + "$id": "161", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1433,9 +1395,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "167", + "$id": "162", "Type": { - "$ref": "166" + "$ref": "161" }, "Value": "application/json" } @@ -1443,7 +1405,7 @@ ], "Responses": [ { - "$id": "168", + "$id": "163", "StatusCodes": [ 200 ], @@ -1470,19 +1432,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "169", + "$id": "164", "Name": "addTimeHeader", "ResourceName": "NewProjectTypeSpec", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "170", + "$id": "165", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Type": { - "$id": "171", + "$id": "166", "Kind": "Primitive", "Name": "DateTimeRFC7231", "IsNullable": false @@ -1498,11 +1460,11 @@ "Kind": "Method" }, { - "$id": "172", + "$id": "167", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "173", + "$id": "168", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1517,9 +1479,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "174", + "$id": "169", "Type": { - "$ref": "173" + "$ref": "168" }, "Value": "application/json" } @@ -1527,7 +1489,7 @@ ], "Responses": [ { - "$id": "175", + "$id": "170", "StatusCodes": [ 204 ], @@ -1543,167 +1505,44 @@ "BufferResponse": true, "GenerateProtocolMethod": true, "GenerateConvenienceMethod": false - }, - { - "$id": "176", - "Name": "stringFormat", - "ResourceName": "NewProjectTypeSpec", - "Description": "paramete has string format.", - "Parameters": [ - { - "$ref": "129" - }, - { - "$id": "177", - "Name": "subscriptionId", - "NameInRequest": "subscriptionId", - "Type": { - "$id": "178", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "Location": "Path", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "179", - "Name": "body", - "NameInRequest": "body", - "Type": { - "$ref": "78" - }, - "Location": "Body", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "180", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "181", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": true, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "182", - "Type": { - "$ref": "181" - }, - "Value": "application/json" - } - }, - { - "$id": "183", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "184", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "185", - "Type": { - "$ref": "184" - }, - "Value": "application/json" - } - } - ], - "Responses": [ - { - "$id": "186", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{firstTestTypeSpecUrl}", - "Path": "/stringFormat/{subscriptionId}", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true } ], "Protocol": { - "$id": "187" + "$id": "171" }, "Creatable": true }, { - "$id": "188", + "$id": "172", "Name": "Hello", "Description": "", "Operations": [], "Protocol": { - "$id": "189" + "$id": "173" }, "Creatable": false, "Parent": "NewProjectTypeSpecClient" }, { - "$id": "190", + "$id": "174", "Name": "HelloDemo", "Description": "Hello world service", "Operations": [ { - "$id": "191", + "$id": "175", "Name": "sayHi", "ResourceName": "Demo", "Description": "Return hi", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "192", + "$id": "176", "Name": "headParameter", "NameInRequest": "head-parameter", "Type": { - "$id": "193", + "$id": "177", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1719,11 +1558,11 @@ "Kind": "Method" }, { - "$id": "194", + "$id": "178", "Name": "queryParameter", "NameInRequest": "queryParameter", "Type": { - "$id": "195", + "$id": "179", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1739,11 +1578,11 @@ "Kind": "Method" }, { - "$id": "196", + "$id": "180", "Name": "optionalQuery", "NameInRequest": "optionalQuery", "Type": { - "$id": "197", + "$id": "181", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1759,11 +1598,11 @@ "Kind": "Method" }, { - "$id": "198", + "$id": "182", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "199", + "$id": "183", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1778,9 +1617,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "200", + "$id": "184", "Type": { - "$ref": "199" + "$ref": "183" }, "Value": "application/json" } @@ -1788,7 +1627,7 @@ ], "Responses": [ { - "$id": "201", + "$id": "185", "StatusCodes": [ 200 ], @@ -1813,31 +1652,31 @@ } ], "Protocol": { - "$id": "202" + "$id": "186" }, "Creatable": false, "Parent": "Hello" }, { - "$id": "203", + "$id": "187", "Name": "HelloDemo2", "Description": "", "Operations": [ { - "$id": "204", + "$id": "188", "Name": "helloAgain", "ResourceName": "Demo2", "Description": "Return hi again", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "205", + "$id": "189", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "206", + "$id": "190", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1853,15 +1692,15 @@ "Kind": "Method" }, { - "$id": "207", + "$id": "191", "Name": "contentType", "NameInRequest": "content-type", "Type": { - "$id": "208", + "$id": "192", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "209", + "$id": "193", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1871,9 +1710,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "210", + "$id": "194", "Type": { - "$ref": "208" + "$ref": "192" }, "Value": "text/plain" }, @@ -1887,11 +1726,11 @@ "Kind": "Constant" }, { - "$id": "211", + "$id": "195", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "212", + "$id": "196", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1907,11 +1746,11 @@ "Kind": "Method" }, { - "$id": "213", + "$id": "197", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "83" + "$ref": "78" }, "Location": "Body", "IsRequired": true, @@ -1924,11 +1763,11 @@ "Kind": "Method" }, { - "$id": "214", + "$id": "198", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "215", + "$id": "199", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1943,9 +1782,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "216", + "$id": "200", "Type": { - "$ref": "215" + "$ref": "199" }, "Value": "application/json" } @@ -1953,12 +1792,12 @@ ], "Responses": [ { - "$id": "217", + "$id": "201", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "83" + "$ref": "78" }, "BodyMediaType": "Json", "Headers": [], @@ -1980,20 +1819,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "218", + "$id": "202", "Name": "noContentType", "ResourceName": "Demo2", "Description": "Return hi again", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "219", + "$id": "203", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "220", + "$id": "204", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2009,11 +1848,11 @@ "Kind": "Method" }, { - "$id": "221", + "$id": "205", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "222", + "$id": "206", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2029,11 +1868,11 @@ "Kind": "Method" }, { - "$id": "223", + "$id": "207", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "83" + "$ref": "78" }, "Location": "Body", "IsRequired": true, @@ -2046,11 +1885,11 @@ "Kind": "Method" }, { - "$id": "224", + "$id": "208", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "225", + "$id": "209", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2065,19 +1904,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "226", + "$id": "210", "Type": { - "$ref": "225" + "$ref": "209" }, "Value": "application/json" } }, { - "$id": "227", + "$id": "211", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "228", + "$id": "212", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2092,9 +1931,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "229", + "$id": "213", "Type": { - "$ref": "228" + "$ref": "212" }, "Value": "application/json" } @@ -2102,12 +1941,12 @@ ], "Responses": [ { - "$id": "230", + "$id": "214", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "83" + "$ref": "78" }, "BodyMediaType": "Json", "Headers": [], @@ -2129,16 +1968,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "231", + "$id": "215", "Name": "createLiteral", "ResourceName": "Demo2", "Description": "Create with literal value", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "232", + "$id": "216", "Name": "body", "NameInRequest": "body", "Type": { @@ -2155,11 +1994,11 @@ "Kind": "Method" }, { - "$id": "233", + "$id": "217", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "234", + "$id": "218", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2174,19 +2013,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "235", + "$id": "219", "Type": { - "$ref": "234" + "$ref": "218" }, "Value": "application/json" } }, { - "$id": "236", + "$id": "220", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "237", + "$id": "221", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2201,9 +2040,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "238", + "$id": "222", "Type": { - "$ref": "237" + "$ref": "221" }, "Value": "application/json" } @@ -2211,7 +2050,7 @@ ], "Responses": [ { - "$id": "239", + "$id": "223", "StatusCodes": [ 200 ], @@ -2238,24 +2077,24 @@ "GenerateConvenienceMethod": true }, { - "$id": "240", + "$id": "224", "Name": "helloLiteral", "ResourceName": "Demo2", "Description": "Send literal parameters", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "241", + "$id": "225", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "242", + "$id": "226", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "243", + "$id": "227", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2265,9 +2104,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "244", + "$id": "228", "Type": { - "$ref": "242" + "$ref": "226" }, "Value": "test" }, @@ -2281,15 +2120,15 @@ "Kind": "Constant" }, { - "$id": "245", + "$id": "229", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "246", + "$id": "230", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "247", + "$id": "231", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -2299,9 +2138,9 @@ }, "Location": "Path", "DefaultValue": { - "$id": "248", + "$id": "232", "Type": { - "$ref": "246" + "$ref": "230" }, "Value": 123 }, @@ -2315,15 +2154,15 @@ "Kind": "Constant" }, { - "$id": "249", + "$id": "233", "Name": "p3", "NameInRequest": "p3", "Type": { - "$id": "250", + "$id": "234", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "251", + "$id": "235", "Kind": "Primitive", "Name": "Boolean", "IsNullable": false @@ -2333,9 +2172,9 @@ }, "Location": "Query", "DefaultValue": { - "$id": "252", + "$id": "236", "Type": { - "$ref": "250" + "$ref": "234" }, "Value": true }, @@ -2349,11 +2188,11 @@ "Kind": "Constant" }, { - "$id": "253", + "$id": "237", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "254", + "$id": "238", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2368,9 +2207,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "255", + "$id": "239", "Type": { - "$ref": "254" + "$ref": "238" }, "Value": "application/json" } @@ -2378,7 +2217,7 @@ ], "Responses": [ { - "$id": "256", + "$id": "240", "StatusCodes": [ 200 ], @@ -2403,27 +2242,27 @@ } ], "Protocol": { - "$id": "257" + "$id": "241" }, "Creatable": false, "Parent": "Hello" }, { - "$id": "258", + "$id": "242", "Name": "EnumTest", "Description": "", "Operations": [ { - "$id": "259", + "$id": "243", "Name": "getUnknownValue", "ResourceName": "EnumTest", "Description": "create extensible enum", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "260", + "$id": "244", "Name": "input", "NameInRequest": "input", "Type": { @@ -2440,11 +2279,11 @@ "Kind": "Method" }, { - "$id": "261", + "$id": "245", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "262", + "$id": "246", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2459,19 +2298,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "263", + "$id": "247", "Type": { - "$ref": "262" + "$ref": "246" }, "Value": "application/json" } }, { - "$id": "264", + "$id": "248", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "265", + "$id": "249", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2486,9 +2325,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "266", + "$id": "250", "Type": { - "$ref": "265" + "$ref": "249" }, "Value": "application/json" } @@ -2496,7 +2335,7 @@ ], "Responses": [ { - "$id": "267", + "$id": "251", "StatusCodes": [ 204 ], @@ -2518,27 +2357,27 @@ } ], "Protocol": { - "$id": "268" + "$id": "252" }, "Creatable": false, "Parent": "NewProjectTypeSpecClient" }, { - "$id": "269", + "$id": "253", "Name": "ProtocolAndConvenient", "Description": "", "Operations": [ { - "$id": "270", + "$id": "254", "Name": "internalProtocol", "ResourceName": "ProtocolAndConvenient", "Description": "When set protocol false and convenient true, then the protocol method should be internal", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "271", + "$id": "255", "Name": "body", "NameInRequest": "body", "Type": { @@ -2555,11 +2394,11 @@ "Kind": "Method" }, { - "$id": "272", + "$id": "256", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "273", + "$id": "257", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2574,19 +2413,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "274", + "$id": "258", "Type": { - "$ref": "273" + "$ref": "257" }, "Value": "application/json" } }, { - "$id": "275", + "$id": "259", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "276", + "$id": "260", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2601,9 +2440,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "277", + "$id": "261", "Type": { - "$ref": "276" + "$ref": "260" }, "Value": "application/json" } @@ -2611,7 +2450,7 @@ ], "Responses": [ { - "$id": "278", + "$id": "262", "StatusCodes": [ 200 ], @@ -2638,20 +2477,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "279", + "$id": "263", "Name": "stillConvenient", "ResourceName": "ProtocolAndConvenient", "Description": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "Parameters": [ { - "$ref": "129" + "$ref": "124" }, { - "$id": "280", + "$id": "264", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "281", + "$id": "265", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2666,9 +2505,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "282", + "$id": "266", "Type": { - "$ref": "281" + "$ref": "265" }, "Value": "application/json" } @@ -2676,7 +2515,7 @@ ], "Responses": [ { - "$id": "283", + "$id": "267", "StatusCodes": [ 204 ], @@ -2695,20 +2534,20 @@ } ], "Protocol": { - "$id": "284" + "$id": "268" }, "Creatable": false, "Parent": "NewProjectTypeSpecClient" } ], "Auth": { - "$id": "285", + "$id": "269", "ApiKey": { - "$id": "286", + "$id": "270", "Name": "x-ms-api-key" }, "OAuth2": { - "$id": "287", + "$id": "271", "Scopes": [ "https://api.example.com/.default" ] diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs index 5d1e70cddde..a46905cb0cb 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs @@ -25,7 +25,7 @@ public void Example_NewProjectTypeSpec_TopAction_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -45,7 +45,7 @@ public async Task Example_NewProjectTypeSpec_TopAction_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -65,7 +65,7 @@ public void Example_NewProjectTypeSpec_TopAction_ShortVersion_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -76,7 +76,7 @@ public async Task Example_NewProjectTypeSpec_TopAction_ShortVersion_Convenience_ AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -87,7 +87,7 @@ public void Example_NewProjectTypeSpec_TopAction_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -111,7 +111,7 @@ public async Task Example_NewProjectTypeSpec_TopAction_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -135,7 +135,7 @@ public void Example_NewProjectTypeSpec_TopAction_AllParameters_Convenience() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = client.TopAction(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -146,7 +146,7 @@ public async Task Example_NewProjectTypeSpec_TopAction_AllParameters_Convenience AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")); + Response response = await client.TopActionAsync(DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z")); } [Test] @@ -740,125 +740,5 @@ public async Task Example_NewProjectTypeSpec_AddTimeHeader_AllParameters_Async() Console.WriteLine(response.Status); } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_NewProjectTypeSpec_StringFormat_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_NewProjectTypeSpec_StringFormat_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_NewProjectTypeSpec_StringFormat_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_NewProjectTypeSpec_StringFormat_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_NewProjectTypeSpec_StringFormat_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_NewProjectTypeSpec_StringFormat_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - sourceUrl = "http://localhost:3000", - guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", - }); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_NewProjectTypeSpec_StringFormat_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = client.StringFormat(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_NewProjectTypeSpec_StringFormat_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - - ModelWithFormat body = new ModelWithFormat(new Uri("http://localhost:3000"), Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - Response response = await client.StringFormatAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), body); - } } } diff --git a/test/UnbrandedProjects/Customized-TypeSpec/Customized-TypeSpec.tsp b/test/UnbrandedProjects/Customized-TypeSpec/Customized-TypeSpec.tsp index 1164337bed3..6b53be168f3 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/Customized-TypeSpec.tsp +++ b/test/UnbrandedProjects/Customized-TypeSpec/Customized-TypeSpec.tsp @@ -137,6 +137,8 @@ model ModelWithRequiredNullableProperties { model NotFriend { @doc("name of the NotFriend") name: string; + + format?: ModelWithFormat; } @doc("this is a model with a projected name") @@ -230,7 +232,7 @@ op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing; @doc("top level method") @get @convenientAPI(true) -op topAction(@path @format("date") action: string): Thing; +op topAction(@path action: utcDateTime): Thing; @route("/top2") @doc("top level method2") @@ -260,12 +262,6 @@ op addTimeHeader( @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime ): void; -@route("/stringFormat") -@doc("parameter has string format.") -@post -@convenientAPI(true) -op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void; - @route("/projectedName") @doc("Model can have its projected name") diff --git a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/ModelWithFormat.cs b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/ModelWithFormat.cs index f22f9225ecd..eac7e137f30 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/ModelWithFormat.cs +++ b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/ModelWithFormat.cs @@ -59,8 +59,8 @@ internal ModelWithFormat() } /// url format. - public Uri SourceUrl { get; } + public Uri SourceUrl { get; set; } /// uuid format. - public Guid Guid { get; } + public Guid Guid { get; set; } } } diff --git a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.Serialization.cs b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.Serialization.cs index 3d63b27a1e9..4de6f50b751 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.Serialization.cs +++ b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.Serialization.cs @@ -23,6 +23,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"u8); + writer.WriteObjectValue(Format, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -62,6 +67,7 @@ internal static SuperFriend DeserializeSuperFriend(JsonElement element, ModelRea return null; } string name = default; + ModelWithFormat format = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -71,13 +77,22 @@ internal static SuperFriend DeserializeSuperFriend(JsonElement element, ModelRea name = property.Value.GetString(); continue; } + if (property.NameEquals("format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + format = ModelWithFormat.DeserializeModelWithFormat(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new SuperFriend(name, serializedAdditionalRawData); + return new SuperFriend(name, format, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.cs b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.cs index 11a9190da49..f1a8a875683 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.cs +++ b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/Models/SuperFriend.cs @@ -54,10 +54,12 @@ public SuperFriend(string name) /// Initializes a new instance of . /// name of the NotFriend. + /// /// Keeps track of any properties unknown to the library. - internal SuperFriend(string name, IDictionary serializedAdditionalRawData) + internal SuperFriend(string name, ModelWithFormat format, IDictionary serializedAdditionalRawData) { Name = name; + Format = format; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -68,5 +70,7 @@ internal SuperFriend() /// name of the NotFriend. public string Name { get; set; } + /// Gets or sets the format. + public ModelWithFormat Format { get; set; } } } diff --git a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/SuperClient.cs b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/SuperClient.cs index 0c9720d0220..735c8fabd19 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/SuperClient.cs +++ b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/SuperClient.cs @@ -810,90 +810,6 @@ public virtual ClientResult AddTimeHeader(RequestOptions options = null) return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options)); } - /// parameter has string format. - /// The to use. - /// The to use. - /// is null. - public virtual async Task StringFormatAsync(Guid subscriptionId, ModelWithFormat body) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = body.ToBinaryContent(); - ClientResult result = await StringFormatAsync(subscriptionId, content, null).ConfigureAwait(false); - return result; - } - - /// parameter has string format. - /// The to use. - /// The to use. - /// is null. - public virtual ClientResult StringFormat(Guid subscriptionId, ModelWithFormat body) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = body.ToBinaryContent(); - ClientResult result = StringFormat(subscriptionId, content, null); - return result; - } - - /// - /// [Protocol Method] parameter has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task StringFormatAsync(Guid subscriptionId, BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateStringFormatRequest(subscriptionId, content, options); - return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// - /// [Protocol Method] parameter has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult StringFormat(Guid subscriptionId, BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateStringFormatRequest(subscriptionId, content, options); - return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options)); - } - /// Model can have its projected name. /// this is a model with a projected name. /// is null. @@ -1455,24 +1371,6 @@ internal PipelineMessage CreateAddTimeHeaderRequest(RequestOptions options) return message; } - internal PipelineMessage CreateStringFormatRequest(Guid subscriptionId, BinaryContent content, RequestOptions options) - { - var message = _pipeline.CreateMessage(); - message.ResponseClassifier = PipelineMessageClassifier204; - var request = message.Request; - request.Method = "POST"; - var uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/stringFormat/", false); - uri.AppendPath(subscriptionId.ToString(), true); - request.Uri = uri.ToUri(); - request.Headers.Set("Accept", "application/json"); - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - internal PipelineMessage CreateProjectedNameModelRequest(BinaryContent content, RequestOptions options) { var message = _pipeline.CreateMessage(); diff --git a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/tspCodeModel.json b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/tspCodeModel.json index 58b4fe9f1cd..3da45e163bd 100644 --- a/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/tspCodeModel.json +++ b/test/UnbrandedProjects/Customized-TypeSpec/src/Generated/tspCodeModel.json @@ -483,49 +483,60 @@ }, "IsRequired": true, "IsReadOnly": false - } - ] - }, - { - "$id": "61", - "Kind": "Model", - "Name": "ModelWithFormat", - "Namespace": "CustomizedTypeSpec", - "IsNullable": false, - "Usage": "Input", - "Properties": [ - { - "$id": "62", - "Name": "sourceUrl", - "SerializedName": "sourceUrl", - "Description": "url format", - "Type": { - "$id": "63", - "Kind": "Primitive", - "Name": "Uri", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false }, { - "$id": "64", - "Name": "guid", - "SerializedName": "guid", - "Description": "uuid format", + "$id": "61", + "Name": "format", + "SerializedName": "format", + "Description": "", "Type": { - "$id": "65", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false + "$id": "62", + "Kind": "Model", + "Name": "ModelWithFormat", + "Namespace": "CustomizedTypeSpec", + "IsNullable": false, + "Usage": "RoundTrip", + "Properties": [ + { + "$id": "63", + "Name": "sourceUrl", + "SerializedName": "sourceUrl", + "Description": "url format", + "Type": { + "$id": "64", + "Kind": "Primitive", + "Name": "Uri", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false + }, + { + "$id": "65", + "Name": "guid", + "SerializedName": "guid", + "Description": "uuid format", + "Type": { + "$id": "66", + "Kind": "Primitive", + "Name": "Guid", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false + } + ] }, - "IsRequired": true, + "IsRequired": false, "IsReadOnly": false } ] }, { - "$id": "66", + "$ref": "62" + }, + { + "$id": "67", "Kind": "Model", "Name": "ProjectedModel", "Namespace": "CustomizedTypeSpec", @@ -534,12 +545,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "67", + "$id": "68", "Name": "name", "SerializedName": "name", "Description": "name of the ModelWithProjectedName", "Type": { - "$id": "68", + "$id": "69", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -550,7 +561,7 @@ ] }, { - "$id": "69", + "$id": "70", "Kind": "Model", "Name": "ReturnsAnonymousModelResponse", "Namespace": "CustomizedTypeSpec", @@ -561,22 +572,22 @@ ], "Clients": [ { - "$id": "70", + "$id": "71", "Name": "CustomizedTypeSpecClient", "Description": "This is a sample typespec project.", "Operations": [ { - "$id": "71", + "$id": "72", "Name": "sayHi", "ResourceName": "CustomizedTypeSpec", "Description": "Return hi", "Parameters": [ { - "$id": "72", + "$id": "73", "Name": "unbrandedTypeSpecUrl", "NameInRequest": "unbrandedTypeSpecUrl", "Type": { - "$id": "73", + "$id": "74", "Kind": "Primitive", "Name": "Uri", "IsNullable": false @@ -592,11 +603,11 @@ "Kind": "Client" }, { - "$id": "74", + "$id": "75", "Name": "headParameter", "NameInRequest": "head-parameter", "Type": { - "$id": "75", + "$id": "76", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -612,11 +623,11 @@ "Kind": "Method" }, { - "$id": "76", + "$id": "77", "Name": "queryParameter", "NameInRequest": "queryParameter", "Type": { - "$id": "77", + "$id": "78", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -632,11 +643,11 @@ "Kind": "Method" }, { - "$id": "78", + "$id": "79", "Name": "optionalQuery", "NameInRequest": "optionalQuery", "Type": { - "$id": "79", + "$id": "80", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -652,11 +663,11 @@ "Kind": "Method" }, { - "$id": "80", + "$id": "81", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "81", + "$id": "82", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -671,9 +682,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "82", + "$id": "83", "Type": { - "$ref": "81" + "$ref": "82" }, "Value": "application/json" } @@ -681,7 +692,7 @@ ], "Responses": [ { - "$id": "83", + "$id": "84", "StatusCodes": [ 200 ], @@ -705,20 +716,20 @@ "GenerateConvenienceMethod": false }, { - "$id": "84", + "$id": "85", "Name": "helloAgain", "ResourceName": "CustomizedTypeSpec", "Description": "Return hi again", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "85", + "$id": "86", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "86", + "$id": "87", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -734,15 +745,15 @@ "Kind": "Method" }, { - "$id": "87", + "$id": "88", "Name": "contentType", "NameInRequest": "content-type", "Type": { - "$id": "88", + "$id": "89", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "89", + "$id": "90", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -752,9 +763,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "90", + "$id": "91", "Type": { - "$ref": "88" + "$ref": "89" }, "Value": "text/plain" }, @@ -768,11 +779,11 @@ "Kind": "Constant" }, { - "$id": "91", + "$id": "92", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "92", + "$id": "93", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -788,7 +799,7 @@ "Kind": "Method" }, { - "$id": "93", + "$id": "94", "Name": "action", "NameInRequest": "action", "Type": { @@ -805,11 +816,11 @@ "Kind": "Method" }, { - "$id": "94", + "$id": "95", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "95", + "$id": "96", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -824,9 +835,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "96", + "$id": "97", "Type": { - "$ref": "95" + "$ref": "96" }, "Value": "application/json" } @@ -834,7 +845,7 @@ ], "Responses": [ { - "$id": "97", + "$id": "98", "StatusCodes": [ 200 ], @@ -861,20 +872,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "98", + "$id": "99", "Name": "noContentType", "ResourceName": "CustomizedTypeSpec", "Description": "Return hi again", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "99", + "$id": "100", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "100", + "$id": "101", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -890,11 +901,11 @@ "Kind": "Method" }, { - "$id": "101", + "$id": "102", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "102", + "$id": "103", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -910,7 +921,7 @@ "Kind": "Method" }, { - "$id": "103", + "$id": "104", "Name": "action", "NameInRequest": "action", "Type": { @@ -927,11 +938,11 @@ "Kind": "Method" }, { - "$id": "104", + "$id": "105", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "105", + "$id": "106", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -946,19 +957,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "106", + "$id": "107", "Type": { - "$ref": "105" + "$ref": "106" }, "Value": "application/json" } }, { - "$id": "107", + "$id": "108", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "108", + "$id": "109", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -973,9 +984,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "109", + "$id": "110", "Type": { - "$ref": "108" + "$ref": "109" }, "Value": "application/json" } @@ -983,7 +994,7 @@ ], "Responses": [ { - "$id": "110", + "$id": "111", "StatusCodes": [ 200 ], @@ -1010,20 +1021,20 @@ "GenerateConvenienceMethod": false }, { - "$id": "111", + "$id": "112", "Name": "helloDemo2", "ResourceName": "CustomizedTypeSpec", "Description": "Return hi in demo2", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "112", + "$id": "113", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "113", + "$id": "114", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1038,9 +1049,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "114", + "$id": "115", "Type": { - "$ref": "113" + "$ref": "114" }, "Value": "application/json" } @@ -1048,7 +1059,7 @@ ], "Responses": [ { - "$id": "115", + "$id": "116", "StatusCodes": [ 200 ], @@ -1072,16 +1083,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "116", + "$id": "117", "Name": "createLiteral", "ResourceName": "CustomizedTypeSpec", "Description": "Create with literal value", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "117", + "$id": "118", "Name": "body", "NameInRequest": "body", "Type": { @@ -1098,11 +1109,11 @@ "Kind": "Method" }, { - "$id": "118", + "$id": "119", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "119", + "$id": "120", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1117,19 +1128,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "120", + "$id": "121", "Type": { - "$ref": "119" + "$ref": "120" }, "Value": "application/json" } }, { - "$id": "121", + "$id": "122", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "122", + "$id": "123", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1144,9 +1155,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "123", + "$id": "124", "Type": { - "$ref": "122" + "$ref": "123" }, "Value": "application/json" } @@ -1154,7 +1165,7 @@ ], "Responses": [ { - "$id": "124", + "$id": "125", "StatusCodes": [ 200 ], @@ -1181,24 +1192,24 @@ "GenerateConvenienceMethod": true }, { - "$id": "125", + "$id": "126", "Name": "helloLiteral", "ResourceName": "CustomizedTypeSpec", "Description": "Send literal parameters", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "126", + "$id": "127", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "127", + "$id": "128", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "128", + "$id": "129", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1208,9 +1219,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "129", + "$id": "130", "Type": { - "$ref": "127" + "$ref": "128" }, "Value": "test" }, @@ -1224,15 +1235,15 @@ "Kind": "Constant" }, { - "$id": "130", + "$id": "131", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "131", + "$id": "132", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "132", + "$id": "133", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -1242,9 +1253,9 @@ }, "Location": "Path", "DefaultValue": { - "$id": "133", + "$id": "134", "Type": { - "$ref": "131" + "$ref": "132" }, "Value": 123 }, @@ -1258,15 +1269,15 @@ "Kind": "Constant" }, { - "$id": "134", + "$id": "135", "Name": "p3", "NameInRequest": "p3", "Type": { - "$id": "135", + "$id": "136", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "136", + "$id": "137", "Kind": "Primitive", "Name": "Boolean", "IsNullable": false @@ -1276,9 +1287,9 @@ }, "Location": "Query", "DefaultValue": { - "$id": "137", + "$id": "138", "Type": { - "$ref": "135" + "$ref": "136" }, "Value": true }, @@ -1292,11 +1303,11 @@ "Kind": "Constant" }, { - "$id": "138", + "$id": "139", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "139", + "$id": "140", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1311,9 +1322,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "140", + "$id": "141", "Type": { - "$ref": "139" + "$ref": "140" }, "Value": "application/json" } @@ -1321,7 +1332,7 @@ ], "Responses": [ { - "$id": "141", + "$id": "142", "StatusCodes": [ 200 ], @@ -1345,22 +1356,22 @@ "GenerateConvenienceMethod": true }, { - "$id": "142", + "$id": "143", "Name": "topAction", "ResourceName": "CustomizedTypeSpec", "Description": "top level method", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "143", + "$id": "144", "Name": "action", "NameInRequest": "action", "Type": { - "$id": "144", + "$id": "145", "Kind": "Primitive", - "Name": "DateTime", + "Name": "DateTimeRFC3339", "IsNullable": false }, "Location": "Path", @@ -1374,11 +1385,11 @@ "Kind": "Method" }, { - "$id": "145", + "$id": "146", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "146", + "$id": "147", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1393,9 +1404,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "147", + "$id": "148", "Type": { - "$ref": "146" + "$ref": "147" }, "Value": "application/json" } @@ -1403,7 +1414,7 @@ ], "Responses": [ { - "$id": "148", + "$id": "149", "StatusCodes": [ 200 ], @@ -1427,20 +1438,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "149", + "$id": "150", "Name": "topAction2", "ResourceName": "CustomizedTypeSpec", "Description": "top level method2", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "150", + "$id": "151", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "151", + "$id": "152", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1455,9 +1466,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "152", + "$id": "153", "Type": { - "$ref": "151" + "$ref": "152" }, "Value": "application/json" } @@ -1465,7 +1476,7 @@ ], "Responses": [ { - "$id": "153", + "$id": "154", "StatusCodes": [ 200 ], @@ -1489,16 +1500,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "154", + "$id": "155", "Name": "patchAction", "ResourceName": "CustomizedTypeSpec", "Description": "top level patch", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "155", + "$id": "156", "Name": "body", "NameInRequest": "body", "Type": { @@ -1515,11 +1526,11 @@ "Kind": "Method" }, { - "$id": "156", + "$id": "157", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "157", + "$id": "158", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1534,19 +1545,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "158", + "$id": "159", "Type": { - "$ref": "157" + "$ref": "158" }, "Value": "application/json" } }, { - "$id": "159", + "$id": "160", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "160", + "$id": "161", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1561,9 +1572,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "161", + "$id": "162", "Type": { - "$ref": "160" + "$ref": "161" }, "Value": "application/json" } @@ -1571,7 +1582,7 @@ ], "Responses": [ { - "$id": "162", + "$id": "163", "StatusCodes": [ 200 ], @@ -1598,16 +1609,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "163", + "$id": "164", "Name": "anonymousBody", "ResourceName": "CustomizedTypeSpec", "Description": "body parameter without body decorator", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "164", + "$id": "165", "Name": "Thing", "NameInRequest": "Thing", "Description": "A model with a few properties of literal types", @@ -1625,11 +1636,11 @@ "Kind": "Method" }, { - "$id": "165", + "$id": "166", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "166", + "$id": "167", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1644,19 +1655,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "167", + "$id": "168", "Type": { - "$ref": "166" + "$ref": "167" }, "Value": "application/json" } }, { - "$id": "168", + "$id": "169", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "169", + "$id": "170", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1671,9 +1682,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "170", + "$id": "171", "Type": { - "$ref": "169" + "$ref": "170" }, "Value": "application/json" } @@ -1681,7 +1692,7 @@ ], "Responses": [ { - "$id": "171", + "$id": "172", "StatusCodes": [ 200 ], @@ -1708,16 +1719,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "172", + "$id": "173", "Name": "friendlyModel", "ResourceName": "CustomizedTypeSpec", "Description": "Model can have its friendly name", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "173", + "$id": "174", "Name": "Friend", "NameInRequest": "NotFriend", "Description": "this is not a friendly model but with a friendly name", @@ -1735,11 +1746,11 @@ "Kind": "Method" }, { - "$id": "174", + "$id": "175", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "175", + "$id": "176", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1754,19 +1765,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "176", + "$id": "177", "Type": { - "$ref": "175" + "$ref": "176" }, "Value": "application/json" } }, { - "$id": "177", + "$id": "178", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "178", + "$id": "179", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1781,9 +1792,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "179", + "$id": "180", "Type": { - "$ref": "178" + "$ref": "179" }, "Value": "application/json" } @@ -1791,7 +1802,7 @@ ], "Responses": [ { - "$id": "180", + "$id": "181", "StatusCodes": [ 200 ], @@ -1818,19 +1829,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "181", + "$id": "182", "Name": "addTimeHeader", "ResourceName": "CustomizedTypeSpec", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "182", + "$id": "183", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Type": { - "$id": "183", + "$id": "184", "Kind": "Primitive", "Name": "DateTimeRFC7231", "IsNullable": false @@ -1846,11 +1857,11 @@ "Kind": "Method" }, { - "$id": "184", + "$id": "185", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "185", + "$id": "186", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1865,9 +1876,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "186", + "$id": "187", "Type": { - "$ref": "185" + "$ref": "186" }, "Value": "application/json" } @@ -1875,7 +1886,7 @@ ], "Responses": [ { - "$id": "187", + "$id": "188", "StatusCodes": [ 204 ], @@ -1893,144 +1904,21 @@ "GenerateConvenienceMethod": false }, { - "$id": "188", - "Name": "stringFormat", - "ResourceName": "CustomizedTypeSpec", - "Description": "parameter has string format.", - "Parameters": [ - { - "$ref": "72" - }, - { - "$id": "189", - "Name": "subscriptionId", - "NameInRequest": "subscriptionId", - "Type": { - "$id": "190", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "Location": "Path", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "191", - "Name": "body", - "NameInRequest": "body", - "Type": { - "$ref": "61" - }, - "Location": "Body", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "192", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "193", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": true, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "194", - "Type": { - "$ref": "193" - }, - "Value": "application/json" - } - }, - { - "$id": "195", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "196", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "197", - "Type": { - "$ref": "196" - }, - "Value": "application/json" - } - } - ], - "Responses": [ - { - "$id": "198", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{unbrandedTypeSpecUrl}", - "Path": "/stringFormat/{subscriptionId}", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true - }, - { - "$id": "199", + "$id": "189", "Name": "projectedNameModel", "ResourceName": "CustomizedTypeSpec", "Description": "Model can have its projected name", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "200", + "$id": "190", "Name": "ProjectedModel", "NameInRequest": "ModelWithProjectedName", "Description": "this is a model with a projected name", "Type": { - "$ref": "66" + "$ref": "67" }, "Location": "Body", "IsRequired": true, @@ -2043,11 +1931,11 @@ "Kind": "Method" }, { - "$id": "201", + "$id": "191", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "202", + "$id": "192", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2062,19 +1950,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "203", + "$id": "193", "Type": { - "$ref": "202" + "$ref": "192" }, "Value": "application/json" } }, { - "$id": "204", + "$id": "194", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "205", + "$id": "195", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2089,9 +1977,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "206", + "$id": "196", "Type": { - "$ref": "205" + "$ref": "195" }, "Value": "application/json" } @@ -2099,12 +1987,12 @@ ], "Responses": [ { - "$id": "207", + "$id": "197", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "66" + "$ref": "67" }, "BodyMediaType": "Json", "Headers": [], @@ -2126,20 +2014,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "208", + "$id": "198", "Name": "returnsAnonymousModel", "ResourceName": "CustomizedTypeSpec", "Description": "return anonymous model", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "209", + "$id": "199", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "210", + "$id": "200", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2154,9 +2042,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "211", + "$id": "201", "Type": { - "$ref": "210" + "$ref": "200" }, "Value": "application/json" } @@ -2164,12 +2052,12 @@ ], "Responses": [ { - "$id": "212", + "$id": "202", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "69" + "$ref": "70" }, "BodyMediaType": "Json", "Headers": [], @@ -2188,20 +2076,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "213", + "$id": "203", "Name": "getUnknownValue", "ResourceName": "CustomizedTypeSpec", "Description": "get extensible enum", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "214", + "$id": "204", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "215", + "$id": "205", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2216,9 +2104,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "216", + "$id": "206", "Type": { - "$ref": "215" + "$ref": "205" }, "Value": "application/json" } @@ -2226,12 +2114,12 @@ ], "Responses": [ { - "$id": "217", + "$id": "207", "StatusCodes": [ 200 ], "BodyType": { - "$id": "218", + "$id": "208", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2253,16 +2141,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "219", + "$id": "209", "Name": "internalProtocol", "ResourceName": "CustomizedTypeSpec", "Description": "When set protocol false and convenient true, then the protocol method should be internal", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "220", + "$id": "210", "Name": "body", "NameInRequest": "body", "Type": { @@ -2279,11 +2167,11 @@ "Kind": "Method" }, { - "$id": "221", + "$id": "211", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "222", + "$id": "212", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2298,19 +2186,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "223", + "$id": "213", "Type": { - "$ref": "222" + "$ref": "212" }, "Value": "application/json" } }, { - "$id": "224", + "$id": "214", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "225", + "$id": "215", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2325,9 +2213,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "226", + "$id": "216", "Type": { - "$ref": "225" + "$ref": "215" }, "Value": "application/json" } @@ -2335,7 +2223,7 @@ ], "Responses": [ { - "$id": "227", + "$id": "217", "StatusCodes": [ 200 ], @@ -2362,20 +2250,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "228", + "$id": "218", "Name": "stillConvenient", "ResourceName": "CustomizedTypeSpec", "Description": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "229", + "$id": "219", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "230", + "$id": "220", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2390,9 +2278,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "231", + "$id": "221", "Type": { - "$ref": "230" + "$ref": "220" }, "Value": "application/json" } @@ -2400,7 +2288,7 @@ ], "Responses": [ { - "$id": "232", + "$id": "222", "StatusCodes": [ 204 ], @@ -2418,20 +2306,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "233", + "$id": "223", "Name": "headAsBoolean", "ResourceName": "CustomizedTypeSpec", "Description": "head as boolean.", "Parameters": [ { - "$ref": "72" + "$ref": "73" }, { - "$id": "234", + "$id": "224", "Name": "id", "NameInRequest": "id", "Type": { - "$id": "235", + "$id": "225", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2447,11 +2335,11 @@ "Kind": "Method" }, { - "$id": "236", + "$id": "226", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "237", + "$id": "227", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2466,9 +2354,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "238", + "$id": "228", "Type": { - "$ref": "237" + "$ref": "227" }, "Value": "application/json" } @@ -2476,7 +2364,7 @@ ], "Responses": [ { - "$id": "239", + "$id": "229", "StatusCodes": [ 204 ], @@ -2495,15 +2383,15 @@ } ], "Protocol": { - "$id": "240" + "$id": "230" }, "Creatable": true } ], "Auth": { - "$id": "241", + "$id": "231", "ApiKey": { - "$id": "242", + "$id": "232", "Name": "my-api-key" } } diff --git a/test/UnbrandedProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp b/test/UnbrandedProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp index d1645492e1a..409ed763da5 100644 --- a/test/UnbrandedProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp +++ b/test/UnbrandedProjects/Unbranded-TypeSpec/Unbranded-TypeSpec.tsp @@ -216,16 +216,6 @@ union DaysOfWeekExtensibleEnum { Sunday: "Sunday", } -model ModelWithFormat { - @doc("url format") - @format("uri") - sourceUrl: string; - - @doc("uuid format") - @format("uuid") - guid: string; -} - @route("/hello") @doc("Return hi") @get @@ -278,7 +268,7 @@ op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing; @doc("top level method") @get @convenientAPI(true) -op topAction(@path @format("date") action: string): Thing; +op topAction(@path action: utcDateTime): Thing; @route("/top2") @doc("top level method2") @@ -308,13 +298,6 @@ op addTimeHeader( @header("Repeatability-First-Sent") repeatabilityFirstSent?: utcDateTime ): void; -@route("/stringFormat") -@doc("parameter has string format.") -@post -@convenientAPI(true) -op stringFormat(@path @format("uuid") subscriptionId: string, @body body: ModelWithFormat): void; - - @route("/projectedName") @doc("Model can have its projected name") @post diff --git a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs deleted file mode 100644 index a4b5c416228..00000000000 --- a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace UnbrandedTypeSpec.Models -{ - public partial class ModelWithFormat : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("sourceUrl"u8); - writer.WriteStringValue(SourceUrl.AbsoluteUri); - writer.WritePropertyName("guid"u8); - writer.WriteStringValue(Guid); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ModelWithFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeModelWithFormat(document.RootElement, options); - } - - internal static ModelWithFormat DeserializeModelWithFormat(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri sourceUrl = default; - Guid guid = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceUrl"u8)) - { - sourceUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("guid"u8)) - { - guid = property.Value.GetGuid(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ModelWithFormat(sourceUrl, guid, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support writing '{options.Format}' format."); - } - } - - ModelWithFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeModelWithFormat(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ModelWithFormat)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ModelWithFormat FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeModelWithFormat(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs deleted file mode 100644 index 1253d4fbed1..00000000000 --- a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/Models/ModelWithFormat.cs +++ /dev/null @@ -1,78 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace UnbrandedTypeSpec.Models -{ - /// The ModelWithFormat. - public partial class ModelWithFormat - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// url format. - /// uuid format. - /// is null. - public ModelWithFormat(Uri sourceUrl, Guid guid) - { - Argument.AssertNotNull(sourceUrl, nameof(sourceUrl)); - - SourceUrl = sourceUrl; - Guid = guid; - } - - /// Initializes a new instance of . - /// url format. - /// uuid format. - /// Keeps track of any properties unknown to the library. - internal ModelWithFormat(Uri sourceUrl, Guid guid, IDictionary serializedAdditionalRawData) - { - SourceUrl = sourceUrl; - Guid = guid; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ModelWithFormat() - { - } - - /// url format. - public Uri SourceUrl { get; } - /// uuid format. - public Guid Guid { get; } - } -} diff --git a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs index 0dd72e024f1..0fdf4828655 100644 --- a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs +++ b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs @@ -813,90 +813,6 @@ public virtual ClientResult AddTimeHeader(RequestOptions options = null) return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options)); } - /// parameter has string format. - /// The to use. - /// The to use. - /// is null. - public virtual async Task StringFormatAsync(Guid subscriptionId, ModelWithFormat body) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = body.ToBinaryContent(); - ClientResult result = await StringFormatAsync(subscriptionId, content, null).ConfigureAwait(false); - return result; - } - - /// parameter has string format. - /// The to use. - /// The to use. - /// is null. - public virtual ClientResult StringFormat(Guid subscriptionId, ModelWithFormat body) - { - Argument.AssertNotNull(body, nameof(body)); - - using BinaryContent content = body.ToBinaryContent(); - ClientResult result = StringFormat(subscriptionId, content, null); - return result; - } - - /// - /// [Protocol Method] parameter has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task StringFormatAsync(Guid subscriptionId, BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateStringFormatRequest(subscriptionId, content, options); - return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// - /// [Protocol Method] parameter has string format. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The to use. - /// The content to send as the body of the request. - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult StringFormat(Guid subscriptionId, BinaryContent content, RequestOptions options = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using PipelineMessage message = CreateStringFormatRequest(subscriptionId, content, options); - return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options)); - } - /// Model can have its projected name. /// this is a model with a projected name. /// is null. @@ -1562,24 +1478,6 @@ internal PipelineMessage CreateAddTimeHeaderRequest(RequestOptions options) return message; } - internal PipelineMessage CreateStringFormatRequest(Guid subscriptionId, BinaryContent content, RequestOptions options) - { - var message = _pipeline.CreateMessage(); - message.ResponseClassifier = PipelineMessageClassifier204; - var request = message.Request; - request.Method = "POST"; - var uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/stringFormat/", false); - uri.AppendPath(subscriptionId.ToString(), true); - request.Uri = uri.ToUri(); - request.Headers.Set("Accept", "application/json"); - request.Headers.Set("Content-Type", "application/json"); - request.Content = content; - message.Apply(options); - return message; - } - internal PipelineMessage CreateProjectedNameModelRequest(BinaryContent content, RequestOptions options) { var message = _pipeline.CreateMessage(); diff --git a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/tspCodeModel.json b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/tspCodeModel.json index c578660fddc..6285e63bdb6 100644 --- a/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/tspCodeModel.json +++ b/test/UnbrandedProjects/Unbranded-TypeSpec/src/Generated/tspCodeModel.json @@ -1035,44 +1035,6 @@ { "$id": "134", "Kind": "Model", - "Name": "ModelWithFormat", - "Namespace": "UnbrandedTypeSpec", - "IsNullable": false, - "Usage": "Input", - "Properties": [ - { - "$id": "135", - "Name": "sourceUrl", - "SerializedName": "sourceUrl", - "Description": "url format", - "Type": { - "$id": "136", - "Kind": "Primitive", - "Name": "Uri", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - }, - { - "$id": "137", - "Name": "guid", - "SerializedName": "guid", - "Description": "uuid format", - "Type": { - "$id": "138", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "IsRequired": true, - "IsReadOnly": false - } - ] - }, - { - "$id": "139", - "Kind": "Model", "Name": "ProjectedModel", "Namespace": "UnbrandedTypeSpec", "Description": "this is a model with a projected name", @@ -1080,12 +1042,12 @@ "Usage": "RoundTrip", "Properties": [ { - "$id": "140", + "$id": "135", "Name": "name", "SerializedName": "name", "Description": "name of the ModelWithProjectedName", "Type": { - "$id": "141", + "$id": "136", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1096,7 +1058,7 @@ ] }, { - "$id": "142", + "$id": "137", "Kind": "Model", "Name": "ReturnsAnonymousModelResponse", "Namespace": "UnbrandedTypeSpec", @@ -1107,22 +1069,22 @@ ], "Clients": [ { - "$id": "143", + "$id": "138", "Name": "UnbrandedTypeSpecClient", "Description": "This is a sample typespec project.", "Operations": [ { - "$id": "144", + "$id": "139", "Name": "sayHi", "ResourceName": "UnbrandedTypeSpec", "Description": "Return hi", "Parameters": [ { - "$id": "145", + "$id": "140", "Name": "unbrandedTypeSpecUrl", "NameInRequest": "unbrandedTypeSpecUrl", "Type": { - "$id": "146", + "$id": "141", "Kind": "Primitive", "Name": "Uri", "IsNullable": false @@ -1138,11 +1100,11 @@ "Kind": "Client" }, { - "$id": "147", + "$id": "142", "Name": "headParameter", "NameInRequest": "head-parameter", "Type": { - "$id": "148", + "$id": "143", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1158,11 +1120,11 @@ "Kind": "Method" }, { - "$id": "149", + "$id": "144", "Name": "queryParameter", "NameInRequest": "queryParameter", "Type": { - "$id": "150", + "$id": "145", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1178,11 +1140,11 @@ "Kind": "Method" }, { - "$id": "151", + "$id": "146", "Name": "optionalQuery", "NameInRequest": "optionalQuery", "Type": { - "$id": "152", + "$id": "147", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1198,11 +1160,11 @@ "Kind": "Method" }, { - "$id": "153", + "$id": "148", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "154", + "$id": "149", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1217,9 +1179,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "155", + "$id": "150", "Type": { - "$ref": "154" + "$ref": "149" }, "Value": "application/json" } @@ -1227,7 +1189,7 @@ ], "Responses": [ { - "$id": "156", + "$id": "151", "StatusCodes": [ 200 ], @@ -1251,20 +1213,20 @@ "GenerateConvenienceMethod": false }, { - "$id": "157", + "$id": "152", "Name": "helloAgain", "ResourceName": "UnbrandedTypeSpec", "Description": "Return hi again", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "158", + "$id": "153", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "159", + "$id": "154", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1280,15 +1242,15 @@ "Kind": "Method" }, { - "$id": "160", + "$id": "155", "Name": "contentType", "NameInRequest": "content-type", "Type": { - "$id": "161", + "$id": "156", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "162", + "$id": "157", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1298,9 +1260,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "163", + "$id": "158", "Type": { - "$ref": "161" + "$ref": "156" }, "Value": "text/plain" }, @@ -1314,11 +1276,11 @@ "Kind": "Constant" }, { - "$id": "164", + "$id": "159", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "165", + "$id": "160", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1334,7 +1296,7 @@ "Kind": "Method" }, { - "$id": "166", + "$id": "161", "Name": "action", "NameInRequest": "action", "Type": { @@ -1351,11 +1313,11 @@ "Kind": "Method" }, { - "$id": "167", + "$id": "162", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "168", + "$id": "163", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1370,9 +1332,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "169", + "$id": "164", "Type": { - "$ref": "168" + "$ref": "163" }, "Value": "application/json" } @@ -1380,7 +1342,7 @@ ], "Responses": [ { - "$id": "170", + "$id": "165", "StatusCodes": [ 200 ], @@ -1407,20 +1369,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "171", + "$id": "166", "Name": "noContentType", "ResourceName": "UnbrandedTypeSpec", "Description": "Return hi again", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "172", + "$id": "167", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "173", + "$id": "168", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1436,11 +1398,11 @@ "Kind": "Method" }, { - "$id": "174", + "$id": "169", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "175", + "$id": "170", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1456,7 +1418,7 @@ "Kind": "Method" }, { - "$id": "176", + "$id": "171", "Name": "action", "NameInRequest": "action", "Type": { @@ -1473,11 +1435,11 @@ "Kind": "Method" }, { - "$id": "177", + "$id": "172", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "178", + "$id": "173", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1492,19 +1454,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "179", + "$id": "174", "Type": { - "$ref": "178" + "$ref": "173" }, "Value": "application/json" } }, { - "$id": "180", + "$id": "175", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "181", + "$id": "176", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1519,9 +1481,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "182", + "$id": "177", "Type": { - "$ref": "181" + "$ref": "176" }, "Value": "application/json" } @@ -1529,7 +1491,7 @@ ], "Responses": [ { - "$id": "183", + "$id": "178", "StatusCodes": [ 200 ], @@ -1556,20 +1518,20 @@ "GenerateConvenienceMethod": false }, { - "$id": "184", + "$id": "179", "Name": "helloDemo2", "ResourceName": "UnbrandedTypeSpec", "Description": "Return hi in demo2", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "185", + "$id": "180", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "186", + "$id": "181", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1584,9 +1546,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "187", + "$id": "182", "Type": { - "$ref": "186" + "$ref": "181" }, "Value": "application/json" } @@ -1594,7 +1556,7 @@ ], "Responses": [ { - "$id": "188", + "$id": "183", "StatusCodes": [ 200 ], @@ -1618,16 +1580,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "189", + "$id": "184", "Name": "createLiteral", "ResourceName": "UnbrandedTypeSpec", "Description": "Create with literal value", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "190", + "$id": "185", "Name": "body", "NameInRequest": "body", "Type": { @@ -1644,11 +1606,11 @@ "Kind": "Method" }, { - "$id": "191", + "$id": "186", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "192", + "$id": "187", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1663,19 +1625,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "193", + "$id": "188", "Type": { - "$ref": "192" + "$ref": "187" }, "Value": "application/json" } }, { - "$id": "194", + "$id": "189", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "195", + "$id": "190", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1690,9 +1652,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "196", + "$id": "191", "Type": { - "$ref": "195" + "$ref": "190" }, "Value": "application/json" } @@ -1700,7 +1662,7 @@ ], "Responses": [ { - "$id": "197", + "$id": "192", "StatusCodes": [ 200 ], @@ -1727,24 +1689,24 @@ "GenerateConvenienceMethod": true }, { - "$id": "198", + "$id": "193", "Name": "helloLiteral", "ResourceName": "UnbrandedTypeSpec", "Description": "Send literal parameters", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "199", + "$id": "194", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "200", + "$id": "195", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "201", + "$id": "196", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1754,9 +1716,9 @@ }, "Location": "Header", "DefaultValue": { - "$id": "202", + "$id": "197", "Type": { - "$ref": "200" + "$ref": "195" }, "Value": "test" }, @@ -1770,15 +1732,15 @@ "Kind": "Constant" }, { - "$id": "203", + "$id": "198", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "204", + "$id": "199", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "205", + "$id": "200", "Kind": "Primitive", "Name": "Int32", "IsNullable": false @@ -1788,9 +1750,9 @@ }, "Location": "Path", "DefaultValue": { - "$id": "206", + "$id": "201", "Type": { - "$ref": "204" + "$ref": "199" }, "Value": 123 }, @@ -1804,15 +1766,15 @@ "Kind": "Constant" }, { - "$id": "207", + "$id": "202", "Name": "p3", "NameInRequest": "p3", "Type": { - "$id": "208", + "$id": "203", "Kind": "Literal", "Name": "Literal", "LiteralValueType": { - "$id": "209", + "$id": "204", "Kind": "Primitive", "Name": "Boolean", "IsNullable": false @@ -1822,9 +1784,9 @@ }, "Location": "Query", "DefaultValue": { - "$id": "210", + "$id": "205", "Type": { - "$ref": "208" + "$ref": "203" }, "Value": true }, @@ -1838,11 +1800,11 @@ "Kind": "Constant" }, { - "$id": "211", + "$id": "206", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "212", + "$id": "207", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1857,9 +1819,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "213", + "$id": "208", "Type": { - "$ref": "212" + "$ref": "207" }, "Value": "application/json" } @@ -1867,7 +1829,7 @@ ], "Responses": [ { - "$id": "214", + "$id": "209", "StatusCodes": [ 200 ], @@ -1891,22 +1853,22 @@ "GenerateConvenienceMethod": true }, { - "$id": "215", + "$id": "210", "Name": "topAction", "ResourceName": "UnbrandedTypeSpec", "Description": "top level method", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "216", + "$id": "211", "Name": "action", "NameInRequest": "action", "Type": { - "$id": "217", + "$id": "212", "Kind": "Primitive", - "Name": "DateTime", + "Name": "DateTimeRFC3339", "IsNullable": false }, "Location": "Path", @@ -1920,11 +1882,11 @@ "Kind": "Method" }, { - "$id": "218", + "$id": "213", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "219", + "$id": "214", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -1939,9 +1901,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "220", + "$id": "215", "Type": { - "$ref": "219" + "$ref": "214" }, "Value": "application/json" } @@ -1949,7 +1911,7 @@ ], "Responses": [ { - "$id": "221", + "$id": "216", "StatusCodes": [ 200 ], @@ -1973,20 +1935,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "222", + "$id": "217", "Name": "topAction2", "ResourceName": "UnbrandedTypeSpec", "Description": "top level method2", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "223", + "$id": "218", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "224", + "$id": "219", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2001,9 +1963,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "225", + "$id": "220", "Type": { - "$ref": "224" + "$ref": "219" }, "Value": "application/json" } @@ -2011,7 +1973,7 @@ ], "Responses": [ { - "$id": "226", + "$id": "221", "StatusCodes": [ 200 ], @@ -2035,16 +1997,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "227", + "$id": "222", "Name": "patchAction", "ResourceName": "UnbrandedTypeSpec", "Description": "top level patch", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "228", + "$id": "223", "Name": "body", "NameInRequest": "body", "Type": { @@ -2061,11 +2023,11 @@ "Kind": "Method" }, { - "$id": "229", + "$id": "224", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "230", + "$id": "225", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2080,19 +2042,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "231", + "$id": "226", "Type": { - "$ref": "230" + "$ref": "225" }, "Value": "application/json" } }, { - "$id": "232", + "$id": "227", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "233", + "$id": "228", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2107,9 +2069,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "234", + "$id": "229", "Type": { - "$ref": "233" + "$ref": "228" }, "Value": "application/json" } @@ -2117,7 +2079,7 @@ ], "Responses": [ { - "$id": "235", + "$id": "230", "StatusCodes": [ 200 ], @@ -2144,16 +2106,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "236", + "$id": "231", "Name": "anonymousBody", "ResourceName": "UnbrandedTypeSpec", "Description": "body parameter without body decorator", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "237", + "$id": "232", "Name": "Thing", "NameInRequest": "Thing", "Description": "A model with a few properties of literal types", @@ -2171,11 +2133,11 @@ "Kind": "Method" }, { - "$id": "238", + "$id": "233", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "239", + "$id": "234", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2190,19 +2152,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "240", + "$id": "235", "Type": { - "$ref": "239" + "$ref": "234" }, "Value": "application/json" } }, { - "$id": "241", + "$id": "236", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "242", + "$id": "237", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2217,9 +2179,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "243", + "$id": "238", "Type": { - "$ref": "242" + "$ref": "237" }, "Value": "application/json" } @@ -2227,7 +2189,7 @@ ], "Responses": [ { - "$id": "244", + "$id": "239", "StatusCodes": [ 200 ], @@ -2254,16 +2216,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "245", + "$id": "240", "Name": "friendlyModel", "ResourceName": "UnbrandedTypeSpec", "Description": "Model can have its friendly name", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "246", + "$id": "241", "Name": "Friend", "NameInRequest": "NotFriend", "Description": "this is not a friendly model but with a friendly name", @@ -2281,11 +2243,11 @@ "Kind": "Method" }, { - "$id": "247", + "$id": "242", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "248", + "$id": "243", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2300,19 +2262,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "249", + "$id": "244", "Type": { - "$ref": "248" + "$ref": "243" }, "Value": "application/json" } }, { - "$id": "250", + "$id": "245", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "251", + "$id": "246", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2327,9 +2289,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "252", + "$id": "247", "Type": { - "$ref": "251" + "$ref": "246" }, "Value": "application/json" } @@ -2337,7 +2299,7 @@ ], "Responses": [ { - "$id": "253", + "$id": "248", "StatusCodes": [ 200 ], @@ -2364,19 +2326,19 @@ "GenerateConvenienceMethod": true }, { - "$id": "254", + "$id": "249", "Name": "addTimeHeader", "ResourceName": "UnbrandedTypeSpec", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "255", + "$id": "250", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Type": { - "$id": "256", + "$id": "251", "Kind": "Primitive", "Name": "DateTimeRFC7231", "IsNullable": false @@ -2392,11 +2354,11 @@ "Kind": "Method" }, { - "$id": "257", + "$id": "252", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "258", + "$id": "253", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2411,9 +2373,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "259", + "$id": "254", "Type": { - "$ref": "258" + "$ref": "253" }, "Value": "application/json" } @@ -2421,7 +2383,7 @@ ], "Responses": [ { - "$id": "260", + "$id": "255", "StatusCodes": [ 204 ], @@ -2439,144 +2401,21 @@ "GenerateConvenienceMethod": false }, { - "$id": "261", - "Name": "stringFormat", - "ResourceName": "UnbrandedTypeSpec", - "Description": "parameter has string format.", - "Parameters": [ - { - "$ref": "145" - }, - { - "$id": "262", - "Name": "subscriptionId", - "NameInRequest": "subscriptionId", - "Type": { - "$id": "263", - "Kind": "Primitive", - "Name": "Guid", - "IsNullable": false - }, - "Location": "Path", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "264", - "Name": "body", - "NameInRequest": "body", - "Type": { - "$ref": "134" - }, - "Location": "Body", - "IsRequired": true, - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Method" - }, - { - "$id": "265", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "266", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": true, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "267", - "Type": { - "$ref": "266" - }, - "Value": "application/json" - } - }, - { - "$id": "268", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "269", - "Kind": "Primitive", - "Name": "String", - "IsNullable": false - }, - "Location": "Header", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": false, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Constant", - "DefaultValue": { - "$id": "270", - "Type": { - "$ref": "269" - }, - "Value": "application/json" - } - } - ], - "Responses": [ - { - "$id": "271", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{unbrandedTypeSpecUrl}", - "Path": "/stringFormat/{subscriptionId}", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true - }, - { - "$id": "272", + "$id": "256", "Name": "projectedNameModel", "ResourceName": "UnbrandedTypeSpec", "Description": "Model can have its projected name", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "273", + "$id": "257", "Name": "ProjectedModel", "NameInRequest": "ModelWithProjectedName", "Description": "this is a model with a projected name", "Type": { - "$ref": "139" + "$ref": "134" }, "Location": "Body", "IsRequired": true, @@ -2589,11 +2428,11 @@ "Kind": "Method" }, { - "$id": "274", + "$id": "258", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "275", + "$id": "259", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2608,19 +2447,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "276", + "$id": "260", "Type": { - "$ref": "275" + "$ref": "259" }, "Value": "application/json" } }, { - "$id": "277", + "$id": "261", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "278", + "$id": "262", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2635,9 +2474,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "279", + "$id": "263", "Type": { - "$ref": "278" + "$ref": "262" }, "Value": "application/json" } @@ -2645,12 +2484,12 @@ ], "Responses": [ { - "$id": "280", + "$id": "264", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "139" + "$ref": "134" }, "BodyMediaType": "Json", "Headers": [], @@ -2672,20 +2511,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "281", + "$id": "265", "Name": "returnsAnonymousModel", "ResourceName": "UnbrandedTypeSpec", "Description": "return anonymous model", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "282", + "$id": "266", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "283", + "$id": "267", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2700,9 +2539,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "284", + "$id": "268", "Type": { - "$ref": "283" + "$ref": "267" }, "Value": "application/json" } @@ -2710,12 +2549,12 @@ ], "Responses": [ { - "$id": "285", + "$id": "269", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "142" + "$ref": "137" }, "BodyMediaType": "Json", "Headers": [], @@ -2734,16 +2573,16 @@ "GenerateConvenienceMethod": true }, { - "$id": "286", + "$id": "270", "Name": "createUnknownValue", "ResourceName": "UnbrandedTypeSpec", "Description": "create extensible enum", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "287", + "$id": "271", "Name": "input", "NameInRequest": "input", "Type": { @@ -2760,11 +2599,11 @@ "Kind": "Method" }, { - "$id": "288", + "$id": "272", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "289", + "$id": "273", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2779,19 +2618,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "290", + "$id": "274", "Type": { - "$ref": "289" + "$ref": "273" }, "Value": "application/json" } }, { - "$id": "291", + "$id": "275", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "292", + "$id": "276", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2806,9 +2645,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "293", + "$id": "277", "Type": { - "$ref": "292" + "$ref": "276" }, "Value": "application/json" } @@ -2816,7 +2655,7 @@ ], "Responses": [ { - "$id": "294", + "$id": "278", "StatusCodes": [ 204 ], @@ -2837,16 +2676,16 @@ "GenerateConvenienceMethod": false }, { - "$id": "295", + "$id": "279", "Name": "internalProtocol", "ResourceName": "UnbrandedTypeSpec", "Description": "When set protocol false and convenient true, then the protocol method should be internal", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "296", + "$id": "280", "Name": "body", "NameInRequest": "body", "Type": { @@ -2863,11 +2702,11 @@ "Kind": "Method" }, { - "$id": "297", + "$id": "281", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "298", + "$id": "282", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2882,19 +2721,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "299", + "$id": "283", "Type": { - "$ref": "298" + "$ref": "282" }, "Value": "application/json" } }, { - "$id": "300", + "$id": "284", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "301", + "$id": "285", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2909,9 +2748,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "302", + "$id": "286", "Type": { - "$ref": "301" + "$ref": "285" }, "Value": "application/json" } @@ -2919,7 +2758,7 @@ ], "Responses": [ { - "$id": "303", + "$id": "287", "StatusCodes": [ 200 ], @@ -2946,20 +2785,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "304", + "$id": "288", "Name": "stillConvenient", "ResourceName": "UnbrandedTypeSpec", "Description": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "305", + "$id": "289", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "306", + "$id": "290", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -2974,9 +2813,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "307", + "$id": "291", "Type": { - "$ref": "306" + "$ref": "290" }, "Value": "application/json" } @@ -2984,7 +2823,7 @@ ], "Responses": [ { - "$id": "308", + "$id": "292", "StatusCodes": [ 204 ], @@ -3002,20 +2841,20 @@ "GenerateConvenienceMethod": true }, { - "$id": "309", + "$id": "293", "Name": "headAsBoolean", "ResourceName": "UnbrandedTypeSpec", "Description": "head as boolean.", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "310", + "$id": "294", "Name": "id", "NameInRequest": "id", "Type": { - "$id": "311", + "$id": "295", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3031,11 +2870,11 @@ "Kind": "Method" }, { - "$id": "312", + "$id": "296", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "313", + "$id": "297", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3050,9 +2889,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "314", + "$id": "298", "Type": { - "$ref": "313" + "$ref": "297" }, "Value": "application/json" } @@ -3060,7 +2899,7 @@ ], "Responses": [ { - "$id": "315", + "$id": "299", "StatusCodes": [ 204 ], @@ -3078,24 +2917,24 @@ "GenerateConvenienceMethod": true }, { - "$id": "316", + "$id": "300", "Name": "handleArray", "ResourceName": "UnbrandedTypeSpec", "Description": "head as boolean.", "Parameters": [ { - "$ref": "145" + "$ref": "140" }, { - "$id": "317", + "$id": "301", "Name": "body", "NameInRequest": "body", "Type": { - "$id": "318", + "$id": "302", "Kind": "Array", "Name": "Array", "ElementType": { - "$id": "319", + "$id": "303", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3113,11 +2952,11 @@ "Kind": "Method" }, { - "$id": "320", + "$id": "304", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "321", + "$id": "305", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3132,19 +2971,19 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "322", + "$id": "306", "Type": { - "$ref": "321" + "$ref": "305" }, "Value": "application/json" } }, { - "$id": "323", + "$id": "307", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "324", + "$id": "308", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3159,9 +2998,9 @@ "Explode": false, "Kind": "Constant", "DefaultValue": { - "$id": "325", + "$id": "309", "Type": { - "$ref": "324" + "$ref": "308" }, "Value": "application/json" } @@ -3169,16 +3008,16 @@ ], "Responses": [ { - "$id": "326", + "$id": "310", "StatusCodes": [ 200 ], "BodyType": { - "$id": "327", + "$id": "311", "Kind": "Array", "Name": "Array", "ElementType": { - "$id": "328", + "$id": "312", "Kind": "Primitive", "Name": "String", "IsNullable": false @@ -3206,15 +3045,15 @@ } ], "Protocol": { - "$id": "329" + "$id": "313" }, "Creatable": true } ], "Auth": { - "$id": "330", + "$id": "314", "ApiKey": { - "$id": "331", + "$id": "315", "Name": "my-api-key" } }