From 6ffceb2cc3f096e432545f76f8f2e9b7d552f037 Mon Sep 17 00:00:00 2001 From: Jorge Rangel Date: Tue, 27 Jan 2026 15:44:53 -0600 Subject: [PATCH] temp --- .../emitter/src/lib/type-converter.ts | 1 + .../emitter/test/Unit/model-type.test.ts | 158 +++++++++++++++ .../src/InputTypes/InputModelType.cs | 8 +- .../Serialization/InputModelTypeConverter.cs | 8 +- .../test/InputModelTypeTests.cs | 149 ++++++++++++++ .../tspCodeModel.json | 165 ++++++++++++++++ .../tspCodeModel.json | 51 +++++ .../tspCodeModel.json | 43 ++++ .../tspCodeModel.json | 45 +++++ .../test/TypeSpecInputConverterTests.cs | 99 ++++++++++ .../Local/Sample-TypeSpec/tspCodeModel.json | 90 +++++++++ .../authentication/api-key/tspCodeModel.json | 5 + .../http/custom/tspCodeModel.json | 5 + .../authentication/oauth2/tspCodeModel.json | 5 + .../http/documentation/tspCodeModel.json | 10 + .../http/encode/array/tspCodeModel.json | 20 ++ .../http/encode/bytes/tspCodeModel.json | 20 ++ .../http/encode/datetime/tspCodeModel.json | 25 +++ .../http/encode/duration/tspCodeModel.json | 70 +++++++ .../http/encode/numeric/tspCodeModel.json | 15 ++ .../http/parameters/basic/tspCodeModel.json | 10 + .../body-optionality/tspCodeModel.json | 5 + .../http/parameters/spread/tspCodeModel.json | 35 ++++ .../content-negotiation/tspCodeModel.json | 5 + .../json-merge-patch/tspCodeModel.json | 15 ++ .../http/payload/multipart/tspCodeModel.json | 18 ++ .../http/payload/pageable/tspCodeModel.json | 90 +++++++++ .../status-code-range/tspCodeModel.json | 20 ++ .../encoded-name/json/tspCodeModel.json | 5 + .../http/special-words/tspCodeModel.json | 175 +++++++++++++++++ .../Spector/http/type/array/tspCodeModel.json | 5 + .../http/type/dictionary/tspCodeModel.json | 5 + .../http/type/model/empty/tspCodeModel.json | 15 ++ .../enum-discriminator/tspCodeModel.json | 20 ++ .../nested-discriminator/tspCodeModel.json | 25 +++ .../not-discriminated/tspCodeModel.json | 15 ++ .../inheritance/recursive/tspCodeModel.json | 10 + .../single-discriminator/tspCodeModel.json | 35 ++++ .../http/type/model/usage/tspCodeModel.json | 15 ++ .../type/model/visibility/tspCodeModel.json | 10 + .../additional-properties/tspCodeModel.json | 185 ++++++++++++++++++ .../type/property/nullable/tspCodeModel.json | 40 ++++ .../property/optionality/tspCodeModel.json | 80 ++++++++ .../property/value-types/tspCodeModel.json | 150 ++++++++++++++ .../union/discriminated/tspCodeModel.json | 10 + .../Spector/http/type/union/tspCodeModel.json | 130 ++++++++++++ .../versioning/added/v1/tspCodeModel.json | 5 + .../versioning/added/v2/tspCodeModel.json | 10 + .../madeOptional/v1/tspCodeModel.json | 5 + .../madeOptional/v2/tspCodeModel.json | 5 + .../versioning/removed/v1/tspCodeModel.json | 15 ++ .../versioning/removed/v2/tspCodeModel.json | 10 + .../removed/v2Preview/tspCodeModel.json | 15 ++ .../renamedFrom/v1/tspCodeModel.json | 5 + .../renamedFrom/v2/tspCodeModel.json | 5 + .../typeChangedFrom/v1/tspCodeModel.json | 5 + .../typeChangedFrom/v2/tspCodeModel.json | 5 + 57 files changed, 2201 insertions(+), 4 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/InputModelTypeTests/XmlSerializationOptionsAreDeserializedCorrectly/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsModelWithBothXmlAndJsonUsage/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsNonXmlModelAddsJsonUsage/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsXmlOnlyModelDoesNotAddJsonUsage/tspCodeModel.json diff --git a/packages/http-client-csharp/emitter/src/lib/type-converter.ts b/packages/http-client-csharp/emitter/src/lib/type-converter.ts index f6b31db5578..8c7b6d06f79 100644 --- a/packages/http-client-csharp/emitter/src/lib/type-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/type-converter.ts @@ -197,6 +197,7 @@ function fromSdkModelType( discriminatorValue: modelType.discriminatorValue, decorators: decorators, external: fromSdkExternalTypeInfo(modelType), + serializationOptions: modelType.serializationOptions, } as InputModelType; sdkContext.__typeCache.updateSdkTypeReferences(modelType, inputModelType); diff --git a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts index c343dab4823..51b9415430b 100644 --- a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts @@ -937,3 +937,161 @@ describe("Usage decorator on enums", () => { strictEqual(colorEnum.values.length, 3); }); }); + +describe("XML serialization options", () => { + let runner: TestHost; + beforeEach(async () => { + runner = await createEmitterTestHost(); + }); + + it("Model and property XML serializationOptions should be parsed correctly with XML content type operation", async function () { + const program = await typeSpecCompile( + ` + @name("XmlBook") + model Book { + @attribute + id: int32; + + @name("BookName") + title: string; + + @unwrapped + authors: string[]; + + content: string; + } + + @route("/books") + @post + op createBook(@header contentType: "application/xml", @body book: Book): Book; + `, + runner, + { IsTCGCNeeded: true, IsXmlNeeded: true }, + ); + + const context = createEmitterContext(program); + const sdkContext = await createCSharpSdkContext(context); + const root = createModel(sdkContext); + const models = root.models; + + const bookModel = models.find((m) => m.name === "Book"); + ok(bookModel); + ok(bookModel.serializationOptions); + ok(bookModel.serializationOptions.xml); + strictEqual(bookModel.serializationOptions.xml.name, "XmlBook"); + + const idProperty = bookModel.properties.find((p) => p.name === "id"); + ok(idProperty); + ok(idProperty.serializationOptions); + ok(idProperty.serializationOptions.xml); + strictEqual(idProperty.serializationOptions.xml.name, "id"); + strictEqual(idProperty.serializationOptions.xml.attribute, true); + strictEqual(idProperty.serializationOptions.xml.unwrapped, false); + + const titleProperty = bookModel.properties.find((p) => p.name === "title"); + ok(titleProperty); + ok(titleProperty.serializationOptions); + ok(titleProperty.serializationOptions.xml); + strictEqual(titleProperty.serializationOptions.xml.name, "BookName"); + strictEqual(titleProperty.serializationOptions.xml.attribute, false); + strictEqual(titleProperty.serializationOptions.xml.unwrapped, false); + + const authorsProperty = bookModel.properties.find((p) => p.name === "authors"); + ok(authorsProperty); + ok(authorsProperty.serializationOptions); + ok(authorsProperty.serializationOptions.xml); + strictEqual(authorsProperty.serializationOptions.xml.name, "authors"); + strictEqual(authorsProperty.serializationOptions.xml.attribute, false); + strictEqual(authorsProperty.serializationOptions.xml.unwrapped, true); + + const contentProperty = bookModel.properties.find((p) => p.name === "content"); + ok(contentProperty); + ok(contentProperty.serializationOptions); + ok(contentProperty.serializationOptions.xml); + strictEqual(contentProperty.serializationOptions.xml.name, "content"); + strictEqual(contentProperty.serializationOptions.xml.attribute, false); + strictEqual(contentProperty.serializationOptions.xml.unwrapped, false); + }); + + it("Property with @name decorator should have correct serializedName from XML options", async function () { + const program = await typeSpecCompile( + ` + model XmlModel { + @name("CustomElementName") + elementValue: string; + + @attribute + @name("attr") + attributeValue: int32; + } + + @route("/xml") + @post + op sendXml(@header contentType: "application/xml", @body data: XmlModel): void; + `, + runner, + { IsTCGCNeeded: true, IsXmlNeeded: true }, + ); + + const context = createEmitterContext(program); + const sdkContext = await createCSharpSdkContext(context); + const root = createModel(sdkContext); + const models = root.models; + + const xmlModel = models.find((m) => m.name === "XmlModel"); + ok(xmlModel); + + const elementProperty = xmlModel.properties.find((p) => p.name === "elementValue"); + ok(elementProperty); + strictEqual(elementProperty.serializedName, "CustomElementName"); + ok(elementProperty.serializationOptions); + ok(elementProperty.serializationOptions.xml); + strictEqual(elementProperty.serializationOptions.xml.name, "CustomElementName"); + strictEqual(elementProperty.serializationOptions.xml.attribute, false); + + const attrProperty = xmlModel.properties.find((p) => p.name === "attributeValue"); + ok(attrProperty); + strictEqual(attrProperty.serializedName, "attr"); + ok(attrProperty.serializationOptions); + ok(attrProperty.serializationOptions.xml); + strictEqual(attrProperty.serializationOptions.xml.name, "attr"); + strictEqual(attrProperty.serializationOptions.xml.attribute, true); + }); + + it("Array property should have itemsName in XML serializationOptions", async function () { + const program = await typeSpecCompile( + ` + model Item { + name: string; + } + + model Container { + items: Item[]; + } + + @route("/container") + @post + op sendContainer(@header contentType: "application/xml", @body container: Container): void; + `, + runner, + { IsTCGCNeeded: true, IsXmlNeeded: true }, + ); + + const context = createEmitterContext(program); + const sdkContext = await createCSharpSdkContext(context); + const root = createModel(sdkContext); + const models = root.models; + + const containerModel = models.find((m) => m.name === "Container"); + ok(containerModel); + + // Validate items property has itemsName + const itemsProperty = containerModel.properties.find((p) => p.name === "items"); + ok(itemsProperty); + ok(itemsProperty.serializationOptions); + ok(itemsProperty.serializationOptions.xml); + strictEqual(itemsProperty.serializationOptions.xml.name, "items"); + ok(itemsProperty.serializationOptions.xml.itemsName); + strictEqual(itemsProperty.serializationOptions.xml.itemsName, "Item"); + }); +}); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputModelType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputModelType.cs index 3f589cc774b..27a808cc354 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputModelType.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputModelType.cs @@ -98,7 +98,13 @@ internal set _discriminatedSubtypes = new Dictionary(value); + InputModelTypeUsage usage = Usage; + if (!usage.HasFlag(InputModelTypeUsage.Xml)) + { + usage |= InputModelTypeUsage.Json; + } var cleanBaseName = Name.ToIdentifierName(); + _discriminatedSubtypes.Add(UnknownDiscriminatorValue, new InputModelType( $"Unknown{cleanBaseName}", @@ -108,7 +114,7 @@ internal set null, null, $"Unknown variant of {cleanBaseName}", - Usage | InputModelTypeUsage.Json, + usage, [], this, [], diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputModelTypeConverter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputModelTypeConverter.cs index 32ae2cc5aee..6b6a4e4acca 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputModelTypeConverter.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputModelTypeConverter.cs @@ -111,9 +111,11 @@ internal static InputModelType CreateModelType(ref Utf8JsonReader reader, string model.Doc = doc; var parsedUsage = Enum.TryParse(usageString, ignoreCase: true, out var usage) ? usage : InputModelTypeUsage.None; - // All models are given a usage of JSON so that they can be persisted regardless of whether - // they are used in requests or responses. - model.Usage = parsedUsage | InputModelTypeUsage.Json; + if (!parsedUsage.HasFlag(InputModelTypeUsage.Xml)) + { + parsedUsage |= InputModelTypeUsage.Json; + } + model.Usage = parsedUsage; model.DiscriminatorValue = discriminatorValue; model.DiscriminatorProperty = discriminatorProperty; model.AdditionalProperties = additionalProperties; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/InputModelTypeTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/InputModelTypeTests.cs index b1cfc0927fd..f3b2aa8b7c4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/InputModelTypeTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/InputModelTypeTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.Json; @@ -117,5 +118,153 @@ public void IsDynamicModelPropagatesWithDiscriminator() Assert.IsNotNull(unknownFooModel); Assert.IsTrue(unknownFooModel!.IsDynamicModel, "UnknownFoo model should be marked as dynamic when base is dynamic"); } + + [Test] + public void XmlSerializationOptionsAreDeserializedCorrectly() + { + var directory = Helpers.GetAssetFileOrDirectoryPath(false); + var content = File.ReadAllText(Path.Combine(directory, "tspCodeModel.json")); + var referenceHandler = new TypeSpecReferenceHandler(); + var options = new JsonSerializerOptions + { + AllowTrailingCommas = true, + Converters = + { + new JsonStringEnumConverter(JsonNamingPolicy.CamelCase), + new InputNamespaceConverter(referenceHandler), + new InputTypeConverter(referenceHandler), + new InputDecoratorInfoConverter(), + new InputModelTypeConverter(referenceHandler), + new InputModelPropertyConverter(referenceHandler), + new InputSerializationOptionsConverter(), + new InputJsonSerializationOptionsConverter(), + new InputXmlSerializationOptionsConverter(), + new InputArrayTypeConverter(referenceHandler), + }, + }; + var inputNamespace = JsonSerializer.Deserialize(content, options); + + Assert.IsNotNull(inputNamespace); + + var xmlBookModel = inputNamespace!.Models.SingleOrDefault(m => m.Name == "XmlBook"); + Assert.IsNotNull(xmlBookModel); + Assert.IsNotNull(xmlBookModel!.SerializationOptions); + Assert.IsNotNull(xmlBookModel.SerializationOptions.Xml); + Assert.AreEqual("XmlBookElement", xmlBookModel.SerializationOptions.Xml!.Name); + + var idProperty = xmlBookModel.Properties.SingleOrDefault(p => p.Name == "id"); + Assert.IsNotNull(idProperty); + Assert.IsNotNull(idProperty!.SerializationOptions); + Assert.IsNotNull(idProperty.SerializationOptions!.Xml); + Assert.AreEqual("id", idProperty.SerializationOptions.Xml!.Name); + Assert.IsTrue(idProperty.SerializationOptions.Xml.Attribute); + Assert.IsFalse(idProperty.SerializationOptions.Xml.Unwrapped); + + var titleProperty = xmlBookModel.Properties.SingleOrDefault(p => p.Name == "title"); + Assert.IsNotNull(titleProperty); + Assert.IsNotNull(titleProperty!.SerializationOptions); + Assert.IsNotNull(titleProperty.SerializationOptions!.Xml); + Assert.AreEqual("BookTitle", titleProperty.SerializationOptions.Xml!.Name); + Assert.IsFalse(titleProperty.SerializationOptions.Xml.Attribute); + Assert.IsFalse(titleProperty.SerializationOptions.Xml.Unwrapped); + Assert.AreEqual("BookTitle", titleProperty.SerializedName); + + var authorsProperty = xmlBookModel.Properties.SingleOrDefault(p => p.Name == "authors"); + Assert.IsNotNull(authorsProperty); + Assert.IsNotNull(authorsProperty!.SerializationOptions); + Assert.IsNotNull(authorsProperty.SerializationOptions!.Xml); + Assert.AreEqual("authors", authorsProperty.SerializationOptions.Xml!.Name); + Assert.IsFalse(authorsProperty.SerializationOptions.Xml.Attribute); + Assert.IsTrue(authorsProperty.SerializationOptions.Xml.Unwrapped); + Assert.AreEqual("author", authorsProperty.SerializationOptions.Xml.ItemsName); + + var contentProperty = xmlBookModel.Properties.SingleOrDefault(p => p.Name == "content"); + Assert.IsNotNull(contentProperty); + Assert.IsNotNull(contentProperty!.SerializationOptions); + Assert.IsNotNull(contentProperty.SerializationOptions!.Xml); + Assert.AreEqual("content", contentProperty.SerializationOptions.Xml!.Name); + Assert.IsFalse(contentProperty.SerializationOptions.Xml.Attribute); + Assert.IsFalse(contentProperty.SerializationOptions.Xml.Unwrapped); + } + + [Test] + public void UnknownDiscriminatedModelWithXmlOnlyUsageDoesNotAddJson() + { + var discriminatorProperty = InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true); + var derivedModel = InputFactory.Model( + "DerivedModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Xml, + properties: [InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true)], + discriminatedKind: "derived"); + + var baseModel = InputFactory.Model( + "BaseModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Xml, + properties: [discriminatorProperty], + discriminatorProperty: discriminatorProperty, + discriminatedModels: new Dictionary { { "derived", derivedModel } }); + + // Verify the unknown discriminated model was created + Assert.IsTrue(baseModel.DiscriminatedSubtypes.ContainsKey("unknown"), "Unknown discriminated subtype should be created"); + var unknownModel = baseModel.DiscriminatedSubtypes["unknown"]; + + // Validate the unknown model has XML flag but NOT Json flag (since base is XML-only) + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Xml), "Unknown model should have Xml usage flag from base"); + Assert.IsFalse(unknownModel.Usage.HasFlag(InputModelTypeUsage.Json), "Unknown model should NOT have Json usage flag when base is XML-only"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Input), "Unknown model should have Input usage flag from base"); + } + + [Test] + public void UnknownDiscriminatedModelWithNonXmlUsageAddsJson() + { + var discriminatorProperty = InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true); + var derivedModel = InputFactory.Model( + "DerivedModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Output, + properties: [InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true)], + discriminatedKind: "derived"); + var baseModel = InputFactory.Model( + "BaseModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Output, + properties: [discriminatorProperty], + discriminatorProperty: discriminatorProperty, + discriminatedModels: new Dictionary { { "derived", derivedModel } }); + + // Verify the unknown discriminated model was created + Assert.IsTrue(baseModel.DiscriminatedSubtypes.ContainsKey("unknown"), "Unknown discriminated subtype should be created"); + var unknownModel = baseModel.DiscriminatedSubtypes["unknown"]; + + // Validate the unknown model has Json flag added (since base is non-XML) + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Json), "Unknown model should have Json usage flag added when base is non-XML"); + Assert.IsFalse(unknownModel.Usage.HasFlag(InputModelTypeUsage.Xml), "Unknown model should NOT have Xml usage flag"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Input), "Unknown model should have Input usage flag from base"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Output), "Unknown model should have Output usage flag from base"); + } + + [Test] + public void UnknownDiscriminatedModelWithBothXmlAndJsonUsageRetainsBoth() + { + var discriminatorProperty = InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true); + var derivedModel = InputFactory.Model( + "DerivedModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Output | InputModelTypeUsage.Xml | InputModelTypeUsage.Json, + properties: [InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true)], + discriminatedKind: "derived"); + + var baseModel = InputFactory.Model( + "BaseModel", + usage: InputModelTypeUsage.Input | InputModelTypeUsage.Output | InputModelTypeUsage.Xml | InputModelTypeUsage.Json, + properties: [discriminatorProperty], + discriminatorProperty: discriminatorProperty, + discriminatedModels: new Dictionary { { "derived", derivedModel } }); + + Assert.IsTrue(baseModel.DiscriminatedSubtypes.ContainsKey("unknown"), "Unknown discriminated subtype should be created"); + var unknownModel = baseModel.DiscriminatedSubtypes["unknown"]; + + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Xml), "Unknown model should have Xml usage flag from base"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Json), "Unknown model should have Json usage flag from base"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Input), "Unknown model should have Input usage flag from base"); + Assert.IsTrue(unknownModel.Usage.HasFlag(InputModelTypeUsage.Output), "Unknown model should have Output usage flag from base"); + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/InputModelTypeTests/XmlSerializationOptionsAreDeserializedCorrectly/tspCodeModel.json b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/InputModelTypeTests/XmlSerializationOptionsAreDeserializedCorrectly/tspCodeModel.json new file mode 100644 index 00000000000..be35fd7726b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/InputModelTypeTests/XmlSerializationOptionsAreDeserializedCorrectly/tspCodeModel.json @@ -0,0 +1,165 @@ +{ + "name": "SampleNamespace", + "models": [ + { + "$id": "1", + "kind": "model", + "name": "XmlBook", + "namespace": "SampleNamespace", + "crossLanguageDefinitionId": "SampleNamespace.XmlBook", + "usage": "Input,Output,Xml", + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "XmlBookElement" + } + } + ], + "serializationOptions": { + "xml": { + "name": "XmlBookElement" + } + }, + "properties": [ + { + "$id": "2", + "kind": "property", + "name": "id", + "serializedName": "id", + "type": { + "$id": "3", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@attribute", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleNamespace.XmlBook.id", + "serializationOptions": { + "xml": { + "name": "id", + "attribute": true, + "unwrapped": false + } + }, + "isHttpMetadata": false + }, + { + "$id": "4", + "kind": "property", + "name": "title", + "serializedName": "BookTitle", + "type": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@name", + "arguments": { + "name": "BookTitle" + } + } + ], + "crossLanguageDefinitionId": "SampleNamespace.XmlBook.title", + "serializationOptions": { + "xml": { + "name": "BookTitle", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false + }, + { + "$id": "6", + "kind": "property", + "name": "authors", + "serializedName": "authors", + "type": { + "$id": "7", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [ + { + "name": "TypeSpec.Xml.@unwrapped", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "SampleNamespace.XmlBook.authors", + "serializationOptions": { + "xml": { + "name": "authors", + "attribute": false, + "unwrapped": true, + "itemsName": "author" + } + }, + "isHttpMetadata": false + }, + { + "$id": "9", + "kind": "property", + "name": "content", + "serializedName": "content", + "type": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleNamespace.XmlBook.content", + "serializationOptions": { + "xml": { + "name": "content", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false + } + ] + } + ], + "clients": [], + "constants": [], + "enums": [], + "auth": {} +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsModelWithBothXmlAndJsonUsage/tspCodeModel.json b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsModelWithBothXmlAndJsonUsage/tspCodeModel.json new file mode 100644 index 00000000000..a995ebbe20a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsModelWithBothXmlAndJsonUsage/tspCodeModel.json @@ -0,0 +1,51 @@ +{ + "$id": "1", + "kind": "model", + "name": "XmlAndJsonModel", + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAndJsonModel", + "usage": "Input,Output,Xml,Json", + "doc": "A model that supports both XML and JSON serialization", + "decorators": [], + "serializationOptions": { + "json": { + "name": "XmlAndJsonModel" + }, + "xml": { + "name": "XmlAndJsonModelElement" + } + }, + "properties": [ + { + "$id": "2", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "name property", + "type": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlAndJsonModel.name", + "serializationOptions": { + "json": { + "name": "name" + }, + "xml": { + "name": "name", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false + } + ] +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsNonXmlModelAddsJsonUsage/tspCodeModel.json b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsNonXmlModelAddsJsonUsage/tspCodeModel.json new file mode 100644 index 00000000000..a14d17a80aa --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsNonXmlModelAddsJsonUsage/tspCodeModel.json @@ -0,0 +1,43 @@ +{ + "$id": "1", + "kind": "model", + "name": "JsonOnlyModel", + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.JsonOnlyModel", + "usage": "Input", + "doc": "A model that only supports JSON serialization", + "decorators": [], + "serializationOptions": { + "json": { + "name": "JsonOnlyModel" + } + }, + "properties": [ + { + "$id": "2", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "name property", + "type": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.JsonOnlyModel.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + } + ] +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsXmlOnlyModelDoesNotAddJsonUsage/tspCodeModel.json b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsXmlOnlyModelDoesNotAddJsonUsage/tspCodeModel.json new file mode 100644 index 00000000000..aa0379450b4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TestData/TypeSpecInputConverterTests/LoadsXmlOnlyModelDoesNotAddJsonUsage/tspCodeModel.json @@ -0,0 +1,45 @@ +{ + "$id": "1", + "kind": "model", + "name": "XmlOnlyModel", + "namespace": "SampleTypeSpec", + "crossLanguageDefinitionId": "SampleTypeSpec.XmlOnlyModel", + "usage": "Input,Xml", + "doc": "A model that only supports XML serialization", + "decorators": [], + "serializationOptions": { + "xml": { + "name": "XmlOnlyModel" + } + }, + "properties": [ + { + "$id": "2", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "name property", + "type": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.XmlOnlyModel.name", + "serializationOptions": { + "xml": { + "name": "name", + "attribute": false, + "unwrapped": false + } + }, + "isHttpMetadata": false + } + ] +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs index a8a59f31433..4acc926d637 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs @@ -639,5 +639,104 @@ public void LoadsModelWithExternalMetadataEndToEnd() Assert.AreEqual("System.Text.Json", externalModel.External.Package); Assert.AreEqual("8.0.0", externalModel.External.MinVersion); } + + [Test] + public void LoadsXmlOnlyModelDoesNotAddJsonUsage() + { + var directory = Helpers.GetAssetFileOrDirectoryPath(false); + var content = File.ReadAllText(Path.Combine(directory, "tspCodeModel.json")); + var referenceHandler = new TypeSpecReferenceHandler(); + var options = new JsonSerializerOptions + { + AllowTrailingCommas = true, + Converters = + { + new JsonStringEnumConverter(JsonNamingPolicy.CamelCase), + new InputTypeConverter(referenceHandler), + new InputDecoratorInfoConverter(), + new InputModelTypeConverter(referenceHandler), + new InputModelPropertyConverter(referenceHandler), + new InputSerializationOptionsConverter(), + new InputJsonSerializationOptionsConverter(), + new InputXmlSerializationOptionsConverter(), + }, + }; + var inputType = JsonSerializer.Deserialize(content, options); + + Assert.IsNotNull(inputType); + + var inputModel = inputType as InputModelType; + Assert.IsNotNull(inputModel); + + Assert.IsTrue(inputModel!.Usage.HasFlag(InputModelTypeUsage.Xml), "Model should have Xml usage flag"); + Assert.IsFalse(inputModel.Usage.HasFlag(InputModelTypeUsage.Json), "XML-only model should NOT have Json usage flag added"); + Assert.IsTrue(inputModel.Usage.HasFlag(InputModelTypeUsage.Input), "Model should retain Input usage flag"); + } + + [Test] + public void LoadsNonXmlModelAddsJsonUsage() + { + var directory = Helpers.GetAssetFileOrDirectoryPath(false); + var content = File.ReadAllText(Path.Combine(directory, "tspCodeModel.json")); + var referenceHandler = new TypeSpecReferenceHandler(); + var options = new JsonSerializerOptions + { + AllowTrailingCommas = true, + Converters = + { + new JsonStringEnumConverter(JsonNamingPolicy.CamelCase), + new InputTypeConverter(referenceHandler), + new InputDecoratorInfoConverter(), + new InputModelTypeConverter(referenceHandler), + new InputModelPropertyConverter(referenceHandler), + new InputSerializationOptionsConverter(), + new InputJsonSerializationOptionsConverter(), + }, + }; + var inputType = JsonSerializer.Deserialize(content, options); + + Assert.IsNotNull(inputType); + + var inputModel = inputType as InputModelType; + Assert.IsNotNull(inputModel); + + Assert.IsTrue(inputModel!.Usage.HasFlag(InputModelTypeUsage.Json), "Non-XML model should have Json usage flag added"); + Assert.IsFalse(inputModel.Usage.HasFlag(InputModelTypeUsage.Xml), "Model should NOT have Xml usage flag"); + Assert.IsTrue(inputModel.Usage.HasFlag(InputModelTypeUsage.Input), "Model should retain Input usage flag"); + } + + [Test] + public void LoadsModelWithBothXmlAndJsonUsage() + { + var directory = Helpers.GetAssetFileOrDirectoryPath(false); + var content = File.ReadAllText(Path.Combine(directory, "tspCodeModel.json")); + var referenceHandler = new TypeSpecReferenceHandler(); + var options = new JsonSerializerOptions + { + AllowTrailingCommas = true, + Converters = + { + new JsonStringEnumConverter(JsonNamingPolicy.CamelCase), + new InputTypeConverter(referenceHandler), + new InputDecoratorInfoConverter(), + new InputModelTypeConverter(referenceHandler), + new InputModelPropertyConverter(referenceHandler), + new InputSerializationOptionsConverter(), + new InputJsonSerializationOptionsConverter(), + new InputXmlSerializationOptionsConverter(), + }, + }; + var inputType = JsonSerializer.Deserialize(content, options); + + Assert.IsNotNull(inputType); + + var inputModel = inputType as InputModelType; + Assert.IsNotNull(inputModel); + + Assert.IsTrue(inputModel!.Usage.HasFlag(InputModelTypeUsage.Xml), "Model should have Xml usage flag"); + Assert.IsTrue(inputModel.Usage.HasFlag(InputModelTypeUsage.Json), "Model should have Json usage flag"); + Assert.IsTrue(inputModel.Usage.HasFlag(InputModelTypeUsage.Input), "Model should have Input usage flag"); + Assert.IsTrue(inputModel.Usage.HasFlag(InputModelTypeUsage.Output), "Model should have Output usage flag"); + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index c24e5729adb..43e7b9552c0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -1815,6 +1815,11 @@ "usage": "Input,Output,Spread,Json", "doc": "A model with a few properties of literal types", "decorators": [], + "serializationOptions": { + "json": { + "name": "Thing" + } + }, "properties": [ { "$id": "197", @@ -2291,6 +2296,11 @@ "usage": "Input,Output,Json", "doc": "this is a roundtrip model", "decorators": [], + "serializationOptions": { + "json": { + "name": "RoundTripModel" + } + }, "properties": [ { "$id": "232", @@ -2871,6 +2881,11 @@ "usage": "Input,Output,Json", "doc": "A model with a few required nullable properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelWithRequiredNullableProperties" + } + }, "properties": [ { "$id": "270", @@ -3013,6 +3028,11 @@ "usage": "Output,Spread,Json", "doc": "this is not a friendly model but with a friendly name", "decorators": [], + "serializationOptions": { + "json": { + "name": "NotFriend" + } + }, "properties": [ { "$id": "280", @@ -3051,6 +3071,11 @@ "usage": "Output,Spread,Json", "doc": "this is a model with a client name", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelWithClientName" + } + }, "properties": [ { "$id": "283", @@ -3088,6 +3113,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [] }, { @@ -3098,6 +3128,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "287", @@ -3162,6 +3197,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "292", @@ -3219,6 +3259,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "296", @@ -3276,6 +3321,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "300", @@ -3308,6 +3358,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Page", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Page" + } + }, "properties": [ { "$id": "302", @@ -3340,6 +3395,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelWithEmbeddedNonBodyParameters" + } + }, "properties": [ { "$id": "304", @@ -3487,6 +3547,11 @@ "arguments": {} } ], + "serializationOptions": { + "json": { + "name": "DynamicModel" + } + }, "properties": [ { "$id": "315", @@ -3723,6 +3788,11 @@ "arguments": {} } ], + "serializationOptions": { + "json": { + "name": "AnotherDynamicModel" + } + }, "properties": [ { "$id": "335", @@ -3961,6 +4031,11 @@ "usage": "Input,Output,Json", "doc": "Base animal with discriminator", "decorators": [], + "serializationOptions": { + "json": { + "name": "Animal" + } + }, "discriminatorProperty": { "$id": "353", "kind": "property", @@ -4029,6 +4104,11 @@ "doc": "Pet is a discriminated animal", "discriminatorValue": "pet", "decorators": [], + "serializationOptions": { + "json": { + "name": "Pet" + } + }, "discriminatorProperty": { "$id": "358", "kind": "property", @@ -4095,6 +4175,11 @@ "doc": "Dog is a specific type of pet with hierarchy building", "discriminatorValue": "dog", "decorators": [], + "serializationOptions": { + "json": { + "name": "Dog" + } + }, "baseModel": { "$ref": "357" }, @@ -4169,6 +4254,11 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getWidgetMetrics.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "366", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json index 76479a3e8d9..6dcf0c35202 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json @@ -12,6 +12,11 @@ "crossLanguageDefinitionId": "Authentication.ApiKey.InvalidAuth", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "InvalidAuth" + } + }, "properties": [ { "$id": "2", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json index ac9f3036c19..aaee9f7681f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json @@ -12,6 +12,11 @@ "crossLanguageDefinitionId": "Authentication.Http.Custom.InvalidAuth", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "InvalidAuth" + } + }, "properties": [ { "$id": "2", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json index 06b2b74d2d4..f4ef47b8189 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json @@ -12,6 +12,11 @@ "crossLanguageDefinitionId": "Authentication.OAuth2.InvalidAuth", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "InvalidAuth" + } + }, "properties": [ { "$id": "2", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/tspCodeModel.json index 703d648ca95..86d05631c51 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/tspCodeModel.json @@ -94,6 +94,11 @@ "usage": "Input,Json", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "decorators": [], + "serializationOptions": { + "json": { + "name": "BulletPointsModel" + } + }, "properties": [ { "$id": "9", @@ -127,6 +132,11 @@ "crossLanguageDefinitionId": "Documentation.Lists.bulletPointsModel.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "11", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/tspCodeModel.json index 627bb564cbf..6b861080654 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/tspCodeModel.json @@ -141,6 +141,11 @@ "crossLanguageDefinitionId": "Encode.Array.CommaDelimitedArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "CommaDelimitedArrayProperty" + } + }, "properties": [ { "$id": "18", @@ -184,6 +189,11 @@ "crossLanguageDefinitionId": "Encode.Array.SpaceDelimitedArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpaceDelimitedArrayProperty" + } + }, "properties": [ { "$id": "22", @@ -216,6 +226,11 @@ "crossLanguageDefinitionId": "Encode.Array.PipeDelimitedArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "PipeDelimitedArrayProperty" + } + }, "properties": [ { "$id": "24", @@ -248,6 +263,11 @@ "crossLanguageDefinitionId": "Encode.Array.NewlineDelimitedArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "NewlineDelimitedArrayProperty" + } + }, "properties": [ { "$id": "26", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/tspCodeModel.json index aa7b4881605..bf92ec111b2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/tspCodeModel.json @@ -429,6 +429,11 @@ "crossLanguageDefinitionId": "Encode.Bytes.DefaultBytesProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "DefaultBytesProperty" + } + }, "properties": [ { "$id": "54", @@ -466,6 +471,11 @@ "crossLanguageDefinitionId": "Encode.Bytes.Base64BytesProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Base64BytesProperty" + } + }, "properties": [ { "$id": "57", @@ -503,6 +513,11 @@ "crossLanguageDefinitionId": "Encode.Bytes.Base64urlBytesProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Base64urlBytesProperty" + } + }, "properties": [ { "$id": "60", @@ -540,6 +555,11 @@ "crossLanguageDefinitionId": "Encode.Bytes.Base64urlArrayBytesProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Base64urlArrayBytesProperty" + } + }, "properties": [ { "$id": "63", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/tspCodeModel.json index 683ced3890b..8094bd11bc3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/tspCodeModel.json @@ -173,6 +173,11 @@ "crossLanguageDefinitionId": "Encode.Datetime.DefaultDatetimeProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "DefaultDatetimeProperty" + } + }, "properties": [ { "$id": "22", @@ -217,6 +222,11 @@ "crossLanguageDefinitionId": "Encode.Datetime.Rfc3339DatetimeProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Rfc3339DatetimeProperty" + } + }, "properties": [ { "$id": "26", @@ -261,6 +271,11 @@ "crossLanguageDefinitionId": "Encode.Datetime.Rfc7231DatetimeProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Rfc7231DatetimeProperty" + } + }, "properties": [ { "$id": "30", @@ -305,6 +320,11 @@ "crossLanguageDefinitionId": "Encode.Datetime.UnixTimestampDatetimeProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnixTimestampDatetimeProperty" + } + }, "properties": [ { "$id": "34", @@ -349,6 +369,11 @@ "crossLanguageDefinitionId": "Encode.Datetime.UnixTimestampArrayDatetimeProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnixTimestampArrayDatetimeProperty" + } + }, "properties": [ { "$id": "38", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json index b1e1d1c9a1a..b13798c6782 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json @@ -461,6 +461,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.DefaultDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "DefaultDurationProperty" + } + }, "properties": [ { "$id": "58", @@ -505,6 +510,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.ISO8601DurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ISO8601DurationProperty" + } + }, "properties": [ { "$id": "62", @@ -549,6 +559,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Int32SecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Int32SecondsDurationProperty" + } + }, "properties": [ { "$id": "66", @@ -593,6 +608,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatSecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatSecondsDurationProperty" + } + }, "properties": [ { "$id": "70", @@ -637,6 +657,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Float64SecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Float64SecondsDurationProperty" + } + }, "properties": [ { "$id": "74", @@ -681,6 +706,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Int32MillisecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Int32MillisecondsDurationProperty" + } + }, "properties": [ { "$id": "78", @@ -725,6 +755,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatMillisecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatMillisecondsDurationProperty" + } + }, "properties": [ { "$id": "82", @@ -769,6 +804,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Float64MillisecondsDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Float64MillisecondsDurationProperty" + } + }, "properties": [ { "$id": "86", @@ -813,6 +853,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatSecondsDurationArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatSecondsDurationArrayProperty" + } + }, "properties": [ { "$id": "90", @@ -879,6 +924,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatMillisecondsDurationArrayProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatMillisecondsDurationArrayProperty" + } + }, "properties": [ { "$id": "97", @@ -945,6 +995,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Int32SecondsLargerUnitDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Int32SecondsLargerUnitDurationProperty" + } + }, "properties": [ { "$id": "104", @@ -989,6 +1044,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatSecondsLargerUnitDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatSecondsLargerUnitDurationProperty" + } + }, "properties": [ { "$id": "108", @@ -1033,6 +1093,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.Int32MillisecondsLargerUnitDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Int32MillisecondsLargerUnitDurationProperty" + } + }, "properties": [ { "$id": "112", @@ -1077,6 +1142,11 @@ "crossLanguageDefinitionId": "Encode.Duration.Property.FloatMillisecondsLargerUnitDurationProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatMillisecondsLargerUnitDurationProperty" + } + }, "properties": [ { "$id": "116", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json index 54625311ee7..51117d86c2e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json @@ -109,6 +109,11 @@ "crossLanguageDefinitionId": "Encode.Numeric.Property.SafeintAsStringProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "SafeintAsStringProperty" + } + }, "properties": [ { "$id": "14", @@ -146,6 +151,11 @@ "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint32AsStringProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Uint32AsStringProperty" + } + }, "properties": [ { "$id": "17", @@ -183,6 +193,11 @@ "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint8AsStringProperty", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Uint8AsStringProperty" + } + }, "properties": [ { "$id": "20", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json index 737c38da954..93cff8e300e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json @@ -46,6 +46,11 @@ "usage": "Input,Json", "doc": "This is a simple model.", "decorators": [], + "serializationOptions": { + "json": { + "name": "User" + } + }, "properties": [ { "$id": "6", @@ -82,6 +87,11 @@ "crossLanguageDefinitionId": "Parameters.Basic.ImplicitBody.simple.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "9", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json index 9216ab627ce..924d4493fb3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json @@ -77,6 +77,11 @@ "crossLanguageDefinitionId": "Parameters.BodyOptionality.BodyModel", "usage": "Input,Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "BodyModel" + } + }, "properties": [ { "$id": "10", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json index 50d33818b8f..3f9fbc8f469 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json @@ -158,6 +158,11 @@ "usage": "Input,Spread,Json", "doc": "This is a simple model.", "decorators": [], + "serializationOptions": { + "json": { + "name": "BodyParameter" + } + }, "properties": [ { "$id": "20", @@ -194,6 +199,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequestMix.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "23", @@ -230,6 +240,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestBody.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "26", @@ -266,6 +281,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerModel.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "29", @@ -302,6 +322,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestParameter.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "32", @@ -338,6 +363,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadWithMultipleParameters.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "35", @@ -467,6 +497,11 @@ "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerAlias.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "46", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json index c5b6d2f643a..1b074c0e509 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json @@ -221,6 +221,11 @@ "crossLanguageDefinitionId": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "PngImageAsJson" + } + }, "properties": [ { "$id": "28", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json index 2b7f5366e84..950f7f2562f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json @@ -142,6 +142,11 @@ "usage": "Input,Output,Json", "doc": "Details about a resource.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Resource" + } + }, "properties": [ { "$id": "18", @@ -217,6 +222,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "It is the model used by Resource model", "decorators": [], + "serializationOptions": { + "json": { + "name": "InnerModel" + } + }, "properties": [ { "$id": "26", @@ -430,6 +440,11 @@ "usage": "Input,JsonMergePatch,Json", "doc": "Details about a resource for patch operation.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ResourcePatch" + } + }, "properties": [ { "$id": "41", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/tspCodeModel.json index f232dcfb1c1..4732c4fe160 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/tspCodeModel.json @@ -477,6 +477,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.MultiPartRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "60", @@ -551,6 +552,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.MultiPartRequestWithWireName", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "65", @@ -625,6 +627,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.MultiPartOptionalRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "70", @@ -699,6 +702,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.ComplexPartsRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "75", @@ -744,6 +748,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.Address", "usage": "Input", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "79", @@ -875,6 +880,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.JsonPartRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "87", @@ -945,6 +951,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.BinaryArrayPartsRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "91", @@ -1026,6 +1033,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.MultiBinaryPartsRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "97", @@ -1101,6 +1109,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FormData.anonymousModel.Request.anonymous", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "102", @@ -1144,6 +1153,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.ComplexHttpPartsModelRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "105", @@ -1216,6 +1226,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileRequiredMetaData", "usage": "Input", "decorators": [], + "serializationOptions": {}, "baseModel": { "$id": "110", "kind": "model", @@ -1226,6 +1237,7 @@ "doc": "A file in an HTTP request, response, or multipart payload.\n\nFiles have a special meaning that the HTTP library understands. When the body of an HTTP request, response,\nor multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the\noperation is treated as a file upload or download.\n\nWhen using file bodies, the fields of the file model are defined to come from particular locations by default:\n\n- `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).\n- `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload\n(MAY be overridden or changed).\n\nA File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit\n`Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,\nit will have a structure like:\n\n```\n{\n \"contentType\": ,\n \"filename\": ,\n \"contents\": \n}\n```\n\nThe `contentType` _within_ the file defines what media types the data inside the file can be, but if the specification\ndefines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is\nserialized_. See the examples below for more information.\n\nNOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename`\n(`Content-Disposition: ; filename=`) is only valid in HTTP responses and multipart payloads. If\nyou wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the\n`filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` location\nis overridden, as shown in the examples below.", "summary": "A file in an HTTP request, response, or multipart payload.", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "111", @@ -1514,6 +1526,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "130", @@ -1528,6 +1541,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileSpecificContentType", "usage": "Input", "decorators": [], + "serializationOptions": {}, "baseModel": { "$ref": "110" }, @@ -1676,6 +1690,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "141", @@ -1720,6 +1735,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileWithHttpPartOptionalContentTypeRequest", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "143", @@ -1734,6 +1750,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FileOptionalContentType", "usage": "Input", "decorators": [], + "serializationOptions": {}, "baseModel": { "$ref": "110" }, @@ -1860,6 +1877,7 @@ "crossLanguageDefinitionId": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", "usage": "Input,MultipartFormData", "decorators": [], + "serializationOptions": {}, "properties": [ { "$id": "152", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/tspCodeModel.json index d6321f97197..d988694b345 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/tspCodeModel.json @@ -189,6 +189,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.link.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "24", @@ -207,6 +212,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.Pet", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Pet" + } + }, "properties": [ { "$id": "27", @@ -314,6 +324,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.linkString.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "34", @@ -371,6 +386,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.nestedLink.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "38", @@ -385,6 +405,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.nestedLink.Response.nestedItems.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "40", @@ -435,6 +460,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.nestedLink.Response.nestedNext.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "43", @@ -492,6 +522,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.PageSize.listWithoutContinuation.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "46", @@ -524,6 +559,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.PageSize.listWithPageSize.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "48", @@ -556,6 +596,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestQueryResponseBody.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "50", @@ -613,6 +658,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestHeaderResponseBody.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "54", @@ -670,6 +720,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestQueryResponseHeader.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "58", @@ -702,6 +757,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestHeaderResponseHeader.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "60", @@ -734,6 +794,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestQueryNestedResponseBody.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "62", @@ -748,6 +813,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestQueryNestedResponseBody.Response.nestedItems.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "64", @@ -798,6 +868,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestQueryNestedResponseBody.Response.nestedNext.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "67", @@ -855,6 +930,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestHeaderNestedResponseBody.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "70", @@ -869,6 +949,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestHeaderNestedResponseBody.Response.nestedItems.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "72", @@ -919,6 +1004,11 @@ "crossLanguageDefinitionId": "Payload.Pageable.ServerDrivenPagination.ContinuationToken.requestHeaderNestedResponseBody.Response.nestedNext.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "75", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/tspCodeModel.json index c135490d214..4934fe7a1a8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/tspCodeModel.json @@ -12,6 +12,11 @@ "crossLanguageDefinitionId": "Response.StatusCodeRange.ErrorInRange", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "ErrorInRange" + } + }, "properties": [ { "$id": "2", @@ -73,6 +78,11 @@ "crossLanguageDefinitionId": "Response.StatusCodeRange.DefaultError", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "DefaultError" + } + }, "properties": [ { "$id": "7", @@ -109,6 +119,11 @@ "crossLanguageDefinitionId": "Response.StatusCodeRange.NotFoundError", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "NotFoundError" + } + }, "properties": [ { "$id": "10", @@ -170,6 +185,11 @@ "crossLanguageDefinitionId": "Response.StatusCodeRange.Standard4XXError", "usage": "Json,Exception", "decorators": [], + "serializationOptions": { + "json": { + "name": "Standard4XXError" + } + }, "properties": [ { "$id": "15", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json index 783a2bbc50c..0d65fbcd241 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json @@ -45,6 +45,11 @@ "crossLanguageDefinitionId": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "JsonEncodedNameModel" + } + }, "properties": [ { "$id": "6", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json index a861c998fad..1422540a9de 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json @@ -573,6 +573,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.and", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "and" + } + }, "properties": [ { "$id": "72", @@ -609,6 +614,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.as", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "as" + } + }, "properties": [ { "$id": "75", @@ -645,6 +655,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.assert", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "assert" + } + }, "properties": [ { "$id": "78", @@ -681,6 +696,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.async", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "async" + } + }, "properties": [ { "$id": "81", @@ -717,6 +737,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.await", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "await" + } + }, "properties": [ { "$id": "84", @@ -753,6 +778,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.break", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "break" + } + }, "properties": [ { "$id": "87", @@ -789,6 +819,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.class", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "class" + } + }, "properties": [ { "$id": "90", @@ -825,6 +860,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.constructor", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "constructor" + } + }, "properties": [ { "$id": "93", @@ -861,6 +901,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.continue", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "continue" + } + }, "properties": [ { "$id": "96", @@ -897,6 +942,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.def", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "def" + } + }, "properties": [ { "$id": "99", @@ -933,6 +983,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.del", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "del" + } + }, "properties": [ { "$id": "102", @@ -969,6 +1024,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.elif", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "elif" + } + }, "properties": [ { "$id": "105", @@ -1005,6 +1065,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.else", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "else" + } + }, "properties": [ { "$id": "108", @@ -1041,6 +1106,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.except", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "except" + } + }, "properties": [ { "$id": "111", @@ -1077,6 +1147,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.exec", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "exec" + } + }, "properties": [ { "$id": "114", @@ -1113,6 +1188,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.finally", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "finally" + } + }, "properties": [ { "$id": "117", @@ -1149,6 +1229,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.for", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "for" + } + }, "properties": [ { "$id": "120", @@ -1185,6 +1270,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.from", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "from" + } + }, "properties": [ { "$id": "123", @@ -1221,6 +1311,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.global", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "global" + } + }, "properties": [ { "$id": "126", @@ -1257,6 +1352,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.if", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "if" + } + }, "properties": [ { "$id": "129", @@ -1293,6 +1393,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.import", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "import" + } + }, "properties": [ { "$id": "132", @@ -1329,6 +1434,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.in", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "in" + } + }, "properties": [ { "$id": "135", @@ -1365,6 +1475,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.is", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "is" + } + }, "properties": [ { "$id": "138", @@ -1401,6 +1516,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.lambda", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "lambda" + } + }, "properties": [ { "$id": "141", @@ -1437,6 +1557,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.not", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "not" + } + }, "properties": [ { "$id": "144", @@ -1473,6 +1598,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.or", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "or" + } + }, "properties": [ { "$id": "147", @@ -1509,6 +1639,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.pass", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "pass" + } + }, "properties": [ { "$id": "150", @@ -1545,6 +1680,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.raise", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "raise" + } + }, "properties": [ { "$id": "153", @@ -1581,6 +1721,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.return", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "return" + } + }, "properties": [ { "$id": "156", @@ -1617,6 +1762,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.try", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "try" + } + }, "properties": [ { "$id": "159", @@ -1653,6 +1803,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.while", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "while" + } + }, "properties": [ { "$id": "162", @@ -1689,6 +1844,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.with", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "with" + } + }, "properties": [ { "$id": "165", @@ -1725,6 +1885,11 @@ "crossLanguageDefinitionId": "SpecialWords.Models.yield", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "yield" + } + }, "properties": [ { "$id": "168", @@ -1761,6 +1926,11 @@ "crossLanguageDefinitionId": "SpecialWords.ModelProperties.SameAsModel", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "SameAsModel" + } + }, "properties": [ { "$id": "171", @@ -1797,6 +1967,11 @@ "crossLanguageDefinitionId": "SpecialWords.ModelProperties.DictMethods", "usage": "Input,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "DictMethods" + } + }, "properties": [ { "$id": "174", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/tspCodeModel.json index 52078f89862..af8ed45b7da 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/tspCodeModel.json @@ -462,6 +462,11 @@ "usage": "Input,Output,Json", "doc": "Array inner model", "decorators": [], + "serializationOptions": { + "json": { + "name": "InnerModel" + } + }, "properties": [ { "$id": "58", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/tspCodeModel.json index 202dcfb1250..84df9ea4255 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/tspCodeModel.json @@ -366,6 +366,11 @@ "usage": "Input,Output,Json", "doc": "Dictionary inner model", "decorators": [], + "serializationOptions": { + "json": { + "name": "InnerModel" + } + }, "properties": [ { "$id": "46", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json index e6de1d5107f..2e8c0cbc1b7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json @@ -78,6 +78,11 @@ "usage": "Input,Json", "doc": "Empty model used in operation parameters", "decorators": [], + "serializationOptions": { + "json": { + "name": "EmptyInput" + } + }, "properties": [] }, { @@ -89,6 +94,11 @@ "usage": "Output,Json", "doc": "Empty model used in operation return type", "decorators": [], + "serializationOptions": { + "json": { + "name": "EmptyOutput" + } + }, "properties": [] }, { @@ -100,6 +110,11 @@ "usage": "Input,Output,Json", "doc": "Empty model used in both parameter and return type", "decorators": [], + "serializationOptions": { + "json": { + "name": "EmptyInputOutput" + } + }, "properties": [] } ], diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/tspCodeModel.json index bbe6d34ad1b..7252d578d83 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/tspCodeModel.json @@ -213,6 +213,11 @@ "usage": "Input,Output,Json", "doc": "Test extensible enum type for discriminator", "decorators": [], + "serializationOptions": { + "json": { + "name": "Dog" + } + }, "discriminatorProperty": { "$id": "24", "kind": "property", @@ -277,6 +282,11 @@ "doc": "Golden dog model", "discriminatorValue": "golden", "decorators": [], + "serializationOptions": { + "json": { + "name": "Golden" + } + }, "baseModel": { "$ref": "23" }, @@ -368,6 +378,11 @@ "usage": "Input,Output,Json", "doc": "Test fixed enum type for discriminator", "decorators": [], + "serializationOptions": { + "json": { + "name": "Snake" + } + }, "discriminatorProperty": { "$id": "34", "kind": "property", @@ -432,6 +447,11 @@ "doc": "Cobra model", "discriminatorValue": "cobra", "decorators": [], + "serializationOptions": { + "json": { + "name": "Cobra" + } + }, "baseModel": { "$ref": "33" }, diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json index 113436b1eb7..aa5a2a9490e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json @@ -174,6 +174,11 @@ "usage": "Input,Output,Json", "doc": "This is base model for polymorphic multiple levels inheritance with a discriminator.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Fish" + } + }, "discriminatorProperty": { "$id": "22", "kind": "property", @@ -241,6 +246,11 @@ "doc": "The second level model in polymorphic multiple levels inheritance and it defines a new discriminator.", "discriminatorValue": "shark", "decorators": [], + "serializationOptions": { + "json": { + "name": "Shark" + } + }, "discriminatorProperty": { "$id": "27", "kind": "property", @@ -306,6 +316,11 @@ "doc": "The third level model SawShark in polymorphic multiple levels inheritance.", "discriminatorValue": "saw", "decorators": [], + "serializationOptions": { + "json": { + "name": "SawShark" + } + }, "baseModel": { "$ref": "26" }, @@ -343,6 +358,11 @@ "doc": "The third level model GoblinShark in polymorphic multiple levels inheritance.", "discriminatorValue": "goblin", "decorators": [], + "serializationOptions": { + "json": { + "name": "GoblinShark" + } + }, "baseModel": { "$ref": "26" }, @@ -382,6 +402,11 @@ "doc": "The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances.", "discriminatorValue": "salmon", "decorators": [], + "serializationOptions": { + "json": { + "name": "Salmon" + } + }, "baseModel": { "$ref": "21" }, diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json index cb96ab1f8b8..f6b350ad159 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json @@ -78,6 +78,11 @@ "usage": "Input,Output,Json", "doc": "The third level model in the normal multiple levels inheritance.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Siamese" + } + }, "baseModel": { "$id": "10", "kind": "model", @@ -87,6 +92,11 @@ "usage": "Input,Output,Json", "doc": "The second level model in the normal multiple levels inheritance.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Cat" + } + }, "baseModel": { "$id": "11", "kind": "model", @@ -96,6 +106,11 @@ "usage": "Input,Output,Json", "doc": "This is base model for not-discriminated normal multiple levels inheritance.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Pet" + } + }, "properties": [ { "$id": "12", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json index 0221ecd1d3d..9a8c123dcbc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json @@ -46,6 +46,11 @@ "usage": "Input,Output,Json", "doc": "extension", "decorators": [], + "serializationOptions": { + "json": { + "name": "Extension" + } + }, "baseModel": { "$id": "6", "kind": "model", @@ -55,6 +60,11 @@ "usage": "Input,Output,Json", "doc": "element", "decorators": [], + "serializationOptions": { + "json": { + "name": "Element" + } + }, "properties": [ { "$id": "7", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json index dbcc50d8653..746fa3c0fbd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json @@ -206,6 +206,11 @@ "usage": "Input,Output,Json", "doc": "This is base model for polymorphic single level inheritance with a discriminator.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Bird" + } + }, "discriminatorProperty": { "$id": "26", "kind": "property", @@ -272,6 +277,11 @@ "doc": "The second level model in polymorphic single level inheritance.", "discriminatorValue": "seagull", "decorators": [], + "serializationOptions": { + "json": { + "name": "SeaGull" + } + }, "baseModel": { "$ref": "25" }, @@ -309,6 +319,11 @@ "doc": "The second level model in polymorphic single level inheritance.", "discriminatorValue": "sparrow", "decorators": [], + "serializationOptions": { + "json": { + "name": "Sparrow" + } + }, "baseModel": { "$ref": "25" }, @@ -346,6 +361,11 @@ "doc": "The second level model in polymorphic single level inheritance.", "discriminatorValue": "goose", "decorators": [], + "serializationOptions": { + "json": { + "name": "Goose" + } + }, "baseModel": { "$ref": "25" }, @@ -383,6 +403,11 @@ "doc": "The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances.", "discriminatorValue": "eagle", "decorators": [], + "serializationOptions": { + "json": { + "name": "Eagle" + } + }, "baseModel": { "$ref": "25" }, @@ -515,6 +540,11 @@ "usage": "Output,Json", "doc": "Define a base class in the legacy way. Discriminator property is not explicitly defined in the model.", "decorators": [], + "serializationOptions": { + "json": { + "name": "Dinosaur" + } + }, "discriminatorProperty": { "$id": "45", "kind": "property", @@ -582,6 +612,11 @@ "doc": "The second level legacy model in polymorphic single level inheritance.", "discriminatorValue": "t-rex", "decorators": [], + "serializationOptions": { + "json": { + "name": "TRex" + } + }, "baseModel": { "$ref": "44" }, diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json index 6ee272fd8c0..5c8712ee703 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json @@ -78,6 +78,11 @@ "usage": "Input,Json", "doc": "Record used in operation parameters", "decorators": [], + "serializationOptions": { + "json": { + "name": "InputRecord" + } + }, "properties": [ { "$id": "10", @@ -115,6 +120,11 @@ "usage": "Output,Json", "doc": "Record used in operation return type", "decorators": [], + "serializationOptions": { + "json": { + "name": "OutputRecord" + } + }, "properties": [ { "$id": "13", @@ -152,6 +162,11 @@ "usage": "Input,Output,Json", "doc": "Record used both as operation parameter and return type", "decorators": [], + "serializationOptions": { + "json": { + "name": "InputOutputRecord" + } + }, "properties": [ { "$id": "16", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json index a0ca49d2ab4..6262ae644a5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json @@ -158,6 +158,11 @@ "usage": "Input,Output,Json", "doc": "Output model with visibility properties.", "decorators": [], + "serializationOptions": { + "json": { + "name": "VisibilityModel" + } + }, "properties": [ { "$id": "20", @@ -314,6 +319,11 @@ "usage": "Input,Output,Json", "doc": "RoundTrip model with readonly optional properties.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ReadOnlyModel" + } + }, "properties": [ { "$id": "33", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/tspCodeModel.json index a93eaebabb2..b55638a8b28 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/tspCodeModel.json @@ -1086,6 +1086,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsUnknownAdditionalProperties" + } + }, "additionalProperties": { "$id": "136", "kind": "unknown", @@ -1131,6 +1136,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a type that extends from Record.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsUnknownAdditionalPropertiesDerived" + } + }, "baseModel": { "$ref": "135" }, @@ -1198,6 +1208,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record with a discriminator.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsUnknownAdditionalPropertiesDiscriminated" + } + }, "additionalProperties": { "$ref": "136" }, @@ -1269,6 +1284,11 @@ "doc": "The derived discriminated type", "discriminatorValue": "derived", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsUnknownAdditionalPropertiesDiscriminatedDerived" + } + }, "baseModel": { "$ref": "144" }, @@ -1362,6 +1382,11 @@ "usage": "Input,Output,Json", "doc": "The model is from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsUnknownAdditionalProperties" + } + }, "additionalProperties": { "$id": "156", "kind": "unknown", @@ -1407,6 +1432,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a type that is Record type", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsUnknownAdditionalPropertiesDerived" + } + }, "baseModel": { "$ref": "155" }, @@ -1474,6 +1504,11 @@ "usage": "Input,Output,Json", "doc": "The model is Record with a discriminator.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsUnknownAdditionalPropertiesDiscriminated" + } + }, "additionalProperties": { "$id": "165", "kind": "unknown", @@ -1549,6 +1584,11 @@ "doc": "The derived discriminated type", "discriminatorValue": "derived", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsUnknownAdditionalPropertiesDiscriminatedDerived" + } + }, "baseModel": { "$ref": "164" }, @@ -1642,6 +1682,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsStringAdditionalProperties" + } + }, "additionalProperties": { "$id": "177", "kind": "string", @@ -1687,6 +1732,11 @@ "usage": "Input,Output,Json", "doc": "The model is from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsStringAdditionalProperties" + } + }, "additionalProperties": { "$id": "181", "kind": "string", @@ -1732,6 +1782,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the same known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadStringRecord" + } + }, "additionalProperties": { "$id": "185", "kind": "string", @@ -1777,6 +1832,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsFloatAdditionalProperties" + } + }, "additionalProperties": { "$id": "189", "kind": "float32", @@ -1822,6 +1882,11 @@ "usage": "Input,Output,Json", "doc": "The model is from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsFloatAdditionalProperties" + } + }, "additionalProperties": { "$id": "193", "kind": "float32", @@ -1867,6 +1932,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the same known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadFloatRecord" + } + }, "additionalProperties": { "$id": "197", "kind": "float32", @@ -1912,6 +1982,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsModelAdditionalProperties" + } + }, "additionalProperties": { "$id": "201", "kind": "model", @@ -1921,6 +1996,11 @@ "usage": "Input,Output,Json", "doc": "model for record", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelForRecord" + } + }, "properties": [ { "$id": "202", @@ -1986,6 +2066,11 @@ "usage": "Input,Output,Json", "doc": "The model is from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsModelAdditionalProperties" + } + }, "additionalProperties": { "$ref": "201" }, @@ -2022,6 +2107,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the same known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadModelRecord" + } + }, "additionalProperties": { "$ref": "201" }, @@ -2058,6 +2148,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtendsModelArrayAdditionalProperties" + } + }, "additionalProperties": { "$id": "210", "kind": "array", @@ -2101,6 +2196,11 @@ "usage": "Input,Output,Json", "doc": "The model is from Record type.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IsModelArrayAdditionalProperties" + } + }, "additionalProperties": { "$ref": "210" }, @@ -2136,6 +2236,11 @@ "crossLanguageDefinitionId": "Type.Property.AdditionalProperties.SpreadModelArrayRecord", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadModelArrayRecord" + } + }, "additionalProperties": { "$ref": "210" }, @@ -2172,6 +2277,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadStringRecord" + } + }, "additionalProperties": { "$id": "217", "kind": "string", @@ -2217,6 +2327,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadFloatRecord" + } + }, "additionalProperties": { "$id": "221", "kind": "float32", @@ -2262,6 +2377,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadModelRecord" + } + }, "additionalProperties": { "$ref": "201" }, @@ -2302,6 +2422,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadModelArrayRecord" + } + }, "additionalProperties": { "$ref": "210" }, @@ -2342,6 +2467,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a model that spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadStringDerived" + } + }, "baseModel": { "$ref": "216" }, @@ -2383,6 +2513,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a model that spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadFloatDerived" + } + }, "baseModel": { "$ref": "220" }, @@ -2424,6 +2559,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a model that spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadModelDerived" + } + }, "baseModel": { "$ref": "224" }, @@ -2461,6 +2601,11 @@ "usage": "Input,Output,Json", "doc": "The model extends from a model that spread Record with the different known property type", "decorators": [], + "serializationOptions": { + "json": { + "name": "DifferentSpreadModelArrayDerived" + } + }, "baseModel": { "$ref": "227" }, @@ -2498,6 +2643,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record and Record", "decorators": [], + "serializationOptions": { + "json": { + "name": "MultipleSpreadRecord" + } + }, "additionalProperties": { "$id": "241", "kind": "union", @@ -2559,6 +2709,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadRecordForUnion" + } + }, "additionalProperties": { "$id": "247", "kind": "union", @@ -2620,6 +2775,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadRecordForNonDiscriminatedUnion" + } + }, "additionalProperties": { "$id": "253", "kind": "union", @@ -2633,6 +2793,11 @@ "crossLanguageDefinitionId": "Type.Property.AdditionalProperties.WidgetData0", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "WidgetData0" + } + }, "properties": [ { "$id": "255", @@ -2690,6 +2855,11 @@ "crossLanguageDefinitionId": "Type.Property.AdditionalProperties.WidgetData1", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "WidgetData1" + } + }, "properties": [ { "$id": "259", @@ -2828,6 +2998,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadRecordForNonDiscriminatedUnion2" + } + }, "additionalProperties": { "$id": "269", "kind": "union", @@ -2841,6 +3016,11 @@ "crossLanguageDefinitionId": "Type.Property.AdditionalProperties.WidgetData2", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "WidgetData2" + } + }, "properties": [ { "$id": "271", @@ -2938,6 +3118,11 @@ "usage": "Input,Output,Json", "doc": "The model spread Record", "decorators": [], + "serializationOptions": { + "json": { + "name": "SpreadRecordForNonDiscriminatedUnion3" + } + }, "additionalProperties": { "$id": "277", "kind": "union", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json index 47e37584c30..606d8272703 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json @@ -686,6 +686,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Template type for testing models with nullable property. Pass in the type of the property you are looking for", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringProperty" + } + }, "properties": [ { "$id": "86", @@ -755,6 +760,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Template type for testing models with nullable property. Pass in the type of the property you are looking for", "decorators": [], + "serializationOptions": { + "json": { + "name": "BytesProperty" + } + }, "properties": [ { "$id": "92", @@ -825,6 +835,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Model with a datetime property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DatetimeProperty" + } + }, "properties": [ { "$id": "98", @@ -902,6 +917,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Model with a duration property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DurationProperty" + } + }, "properties": [ { "$id": "105", @@ -979,6 +999,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Model with collection bytes properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsByteProperty" + } + }, "properties": [ { "$id": "112", @@ -1056,6 +1081,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Model with collection models properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsModelProperty" + } + }, "properties": [ { "$id": "119", @@ -1105,6 +1135,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Inner model used in collections model property", "decorators": [], + "serializationOptions": { + "json": { + "name": "InnerModel" + } + }, "properties": [ { "$id": "125", @@ -1166,6 +1201,11 @@ "usage": "Input,Output,JsonMergePatch,Json", "doc": "Model with collection string properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsStringProperty" + } + }, "properties": [ { "$id": "128", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/tspCodeModel.json index dc12ff55efb..4b2dec8bbd4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/tspCodeModel.json @@ -1307,6 +1307,11 @@ "usage": "Input,Output,Json", "doc": "Template type for testing models with optional property. Pass in the type of the property you are looking for", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringProperty" + } + }, "properties": [ { "$id": "156", @@ -1345,6 +1350,11 @@ "usage": "Input,Output,Json", "doc": "Template type for testing models with optional property. Pass in the type of the property you are looking for", "decorators": [], + "serializationOptions": { + "json": { + "name": "BytesProperty" + } + }, "properties": [ { "$id": "159", @@ -1384,6 +1394,11 @@ "usage": "Input,Output,Json", "doc": "Model with a datetime property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DatetimeProperty" + } + }, "properties": [ { "$id": "162", @@ -1430,6 +1445,11 @@ "usage": "Input,Output,Json", "doc": "Model with a duration property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DurationProperty" + } + }, "properties": [ { "$id": "166", @@ -1476,6 +1496,11 @@ "usage": "Input,Output,Json", "doc": "Model with a plainDate property", "decorators": [], + "serializationOptions": { + "json": { + "name": "PlainDateProperty" + } + }, "properties": [ { "$id": "170", @@ -1514,6 +1539,11 @@ "usage": "Input,Output,Json", "doc": "Model with a plainTime property", "decorators": [], + "serializationOptions": { + "json": { + "name": "PlainTimeProperty" + } + }, "properties": [ { "$id": "173", @@ -1552,6 +1582,11 @@ "usage": "Input,Output,Json", "doc": "Model with collection bytes properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsByteProperty" + } + }, "properties": [ { "$id": "176", @@ -1598,6 +1633,11 @@ "usage": "Input,Output,Json", "doc": "Model with collection models properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsModelProperty" + } + }, "properties": [ { "$id": "180", @@ -1639,6 +1679,11 @@ "usage": "Input,Output,Json", "doc": "Model with string literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringLiteralProperty" + } + }, "properties": [ { "$id": "183", @@ -1673,6 +1718,11 @@ "usage": "Input,Output,Json", "doc": "Model with int literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "IntLiteralProperty" + } + }, "properties": [ { "$id": "185", @@ -1707,6 +1757,11 @@ "usage": "Input,Output,Json", "doc": "Model with float literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatLiteralProperty" + } + }, "properties": [ { "$id": "187", @@ -1741,6 +1796,11 @@ "usage": "Input,Output,Json", "doc": "Model with boolean literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "BooleanLiteralProperty" + } + }, "properties": [ { "$id": "189", @@ -1775,6 +1835,11 @@ "usage": "Input,Output,Json", "doc": "Model with union of string literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionStringLiteralProperty" + } + }, "properties": [ { "$id": "191", @@ -1809,6 +1874,11 @@ "usage": "Input,Output,Json", "doc": "Model with union of int literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionIntLiteralProperty" + } + }, "properties": [ { "$id": "193", @@ -1843,6 +1913,11 @@ "usage": "Input,Output,Json", "doc": "Model with union of float literal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionFloatLiteralProperty" + } + }, "properties": [ { "$id": "195", @@ -1877,6 +1952,11 @@ "usage": "Input,Output,Json", "doc": "Model with required and optional properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "RequiredAndOptionalProperty" + } + }, "properties": [ { "$id": "197", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/tspCodeModel.json index e63c22f19c8..ee363bfbb50 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/tspCodeModel.json @@ -1276,6 +1276,11 @@ "usage": "Input,Output,Json", "doc": "Model with a boolean property", "decorators": [], + "serializationOptions": { + "json": { + "name": "BooleanProperty" + } + }, "properties": [ { "$id": "149", @@ -1314,6 +1319,11 @@ "usage": "Input,Output,Json", "doc": "Model with a string property", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringProperty" + } + }, "properties": [ { "$id": "152", @@ -1352,6 +1362,11 @@ "usage": "Input,Output,Json", "doc": "Model with a bytes property", "decorators": [], + "serializationOptions": { + "json": { + "name": "BytesProperty" + } + }, "properties": [ { "$id": "155", @@ -1391,6 +1406,11 @@ "usage": "Input,Output,Json", "doc": "Model with a int property", "decorators": [], + "serializationOptions": { + "json": { + "name": "IntProperty" + } + }, "properties": [ { "$id": "158", @@ -1429,6 +1449,11 @@ "usage": "Input,Output,Json", "doc": "Model with a float property", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatProperty" + } + }, "properties": [ { "$id": "161", @@ -1467,6 +1492,11 @@ "usage": "Input,Output,Json", "doc": "Model with a decimal property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DecimalProperty" + } + }, "properties": [ { "$id": "164", @@ -1505,6 +1535,11 @@ "usage": "Input,Output,Json", "doc": "Model with a decimal128 property", "decorators": [], + "serializationOptions": { + "json": { + "name": "Decimal128Property" + } + }, "properties": [ { "$id": "167", @@ -1543,6 +1578,11 @@ "usage": "Input,Output,Json", "doc": "Model with a datetime property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DatetimeProperty" + } + }, "properties": [ { "$id": "170", @@ -1589,6 +1629,11 @@ "usage": "Input,Output,Json", "doc": "Model with a duration property", "decorators": [], + "serializationOptions": { + "json": { + "name": "DurationProperty" + } + }, "properties": [ { "$id": "174", @@ -1635,6 +1680,11 @@ "usage": "Input,Output,Json", "doc": "Model with enum properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "EnumProperty" + } + }, "properties": [ { "$id": "178", @@ -1669,6 +1719,11 @@ "usage": "Input,Output,Json", "doc": "Model with extensible enum properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "ExtensibleEnumProperty" + } + }, "properties": [ { "$id": "180", @@ -1703,6 +1758,11 @@ "usage": "Input,Output,Json", "doc": "Model with model properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelProperty" + } + }, "properties": [ { "$id": "182", @@ -1719,6 +1779,11 @@ "usage": "Input,Output,Json", "doc": "Inner model. Will be a property type for ModelWithModelProperties", "decorators": [], + "serializationOptions": { + "json": { + "name": "InnerModel" + } + }, "properties": [ { "$id": "184", @@ -1775,6 +1840,11 @@ "usage": "Input,Output,Json", "doc": "Model with collection string properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsStringProperty" + } + }, "properties": [ { "$id": "187", @@ -1820,6 +1890,11 @@ "usage": "Input,Output,Json", "doc": "Model with collection int properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsIntProperty" + } + }, "properties": [ { "$id": "191", @@ -1865,6 +1940,11 @@ "usage": "Input,Output,Json", "doc": "Model with collection model properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "CollectionsModelProperty" + } + }, "properties": [ { "$id": "195", @@ -1906,6 +1986,11 @@ "usage": "Input,Output,Json", "doc": "Model with dictionary string properties", "decorators": [], + "serializationOptions": { + "json": { + "name": "DictionaryStringProperty" + } + }, "properties": [ { "$id": "198", @@ -1956,6 +2041,11 @@ "usage": "Input,Output,Json", "doc": "Model with a property never. (This property should not be included).", "decorators": [], + "serializationOptions": { + "json": { + "name": "NeverProperty" + } + }, "properties": [] }, { @@ -1967,6 +2057,11 @@ "usage": "Input,Output,Json", "doc": "Model with a property unknown, and the data is a string.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnknownStringProperty" + } + }, "properties": [ { "$id": "204", @@ -2005,6 +2100,11 @@ "usage": "Input,Output,Json", "doc": "Model with a property unknown, and the data is a int32.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnknownIntProperty" + } + }, "properties": [ { "$id": "207", @@ -2043,6 +2143,11 @@ "usage": "Input,Output,Json", "doc": "Model with a property unknown, and the data is a dictionnary.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnknownDictProperty" + } + }, "properties": [ { "$id": "210", @@ -2081,6 +2186,11 @@ "usage": "Input,Output,Json", "doc": "Model with a property unknown, and the data is an array.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnknownArrayProperty" + } + }, "properties": [ { "$id": "213", @@ -2119,6 +2229,11 @@ "usage": "Input,Output,Json", "doc": "Model with a string literal property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringLiteralProperty" + } + }, "properties": [ { "$id": "216", @@ -2153,6 +2268,11 @@ "usage": "Input,Output,Json", "doc": "Model with a int literal property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "IntLiteralProperty" + } + }, "properties": [ { "$id": "218", @@ -2187,6 +2307,11 @@ "usage": "Input,Output,Json", "doc": "Model with a float literal property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "FloatLiteralProperty" + } + }, "properties": [ { "$id": "220", @@ -2221,6 +2346,11 @@ "usage": "Input,Output,Json", "doc": "Model with a boolean literal property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "BooleanLiteralProperty" + } + }, "properties": [ { "$id": "222", @@ -2255,6 +2385,11 @@ "usage": "Input,Output,Json", "doc": "Model with a union of string literal as property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionStringLiteralProperty" + } + }, "properties": [ { "$id": "224", @@ -2289,6 +2424,11 @@ "usage": "Input,Output,Json", "doc": "Model with a union of int literal as property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionIntLiteralProperty" + } + }, "properties": [ { "$id": "226", @@ -2323,6 +2463,11 @@ "usage": "Input,Output,Json", "doc": "Model with a union of float literal as property.", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionFloatLiteralProperty" + } + }, "properties": [ { "$id": "228", @@ -2357,6 +2502,11 @@ "usage": "Input,Output,Json", "doc": "Template type for testing models with specific properties. Pass in the type of the property you are looking for", "decorators": [], + "serializationOptions": { + "json": { + "name": "UnionEnumValueProperty" + } + }, "properties": [ { "$id": "230", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/tspCodeModel.json index 43efef790fe..846dab9a573 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/discriminated/tspCodeModel.json @@ -205,6 +205,11 @@ "crossLanguageDefinitionId": "Type.Union.Discriminated.Cat", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Cat" + } + }, "properties": [ { "$id": "26", @@ -266,6 +271,11 @@ "crossLanguageDefinitionId": "Type.Union.Discriminated.Dog", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Dog" + } + }, "properties": [ { "$id": "31", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/tspCodeModel.json index 90dce66545a..2f02bc4094c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/tspCodeModel.json @@ -801,6 +801,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "85", @@ -833,6 +838,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "87", @@ -865,6 +875,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "89", @@ -897,6 +912,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "91", @@ -929,6 +949,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "93", @@ -961,6 +986,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "95", @@ -993,6 +1023,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "97", @@ -1025,6 +1060,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "99", @@ -1057,6 +1097,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "101", @@ -1089,6 +1134,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "103", @@ -1121,6 +1171,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "105", @@ -1140,6 +1195,11 @@ "crossLanguageDefinitionId": "Type.Union.Cat", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Cat" + } + }, "properties": [ { "$id": "108", @@ -1176,6 +1236,11 @@ "crossLanguageDefinitionId": "Type.Union.Dog", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "Dog" + } + }, "properties": [ { "$id": "111", @@ -1237,6 +1302,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "114", @@ -1269,6 +1339,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "116", @@ -1283,6 +1358,11 @@ "crossLanguageDefinitionId": "Type.Union.EnumsOnlyCases", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "EnumsOnlyCases" + } + }, "properties": [ { "$id": "118", @@ -1356,6 +1436,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "121", @@ -1388,6 +1473,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "123", @@ -1402,6 +1492,11 @@ "crossLanguageDefinitionId": "Type.Union.StringAndArrayCases", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "StringAndArrayCases" + } + }, "properties": [ { "$id": "125", @@ -1518,6 +1613,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "134", @@ -1550,6 +1650,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "136", @@ -1564,6 +1669,11 @@ "crossLanguageDefinitionId": "Type.Union.MixedLiteralsCases", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "MixedLiteralsCases" + } + }, "properties": [ { "$id": "138", @@ -1699,6 +1809,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "144", @@ -1731,6 +1846,11 @@ "crossLanguageDefinitionId": "Type.Union.get.Response.anonymous", "usage": "Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "146", @@ -1745,6 +1865,11 @@ "crossLanguageDefinitionId": "Type.Union.MixedTypesCases", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "MixedTypesCases" + } + }, "properties": [ { "$id": "148", @@ -1917,6 +2042,11 @@ "crossLanguageDefinitionId": "Type.Union.send.Request.anonymous", "usage": "Spread,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "" + } + }, "properties": [ { "$id": "158", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/tspCodeModel.json index 1414fe33165..1892fcd7a4b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/tspCodeModel.json @@ -116,6 +116,11 @@ "crossLanguageDefinitionId": "Versioning.Added.ModelV1", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV1" + } + }, "properties": [ { "$id": "12", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/tspCodeModel.json index cf342b288f8..f2403c714dd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/tspCodeModel.json @@ -241,6 +241,11 @@ "crossLanguageDefinitionId": "Versioning.Added.ModelV1", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV1" + } + }, "properties": [ { "$id": "25", @@ -346,6 +351,11 @@ "crossLanguageDefinitionId": "Versioning.Added.ModelV2", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV2" + } + }, "properties": [ { "$id": "34", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/tspCodeModel.json index fb8b34c15dd..810f8726b13 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/tspCodeModel.json @@ -83,6 +83,11 @@ "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "TestModel" + } + }, "properties": [ { "$id": "9", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/tspCodeModel.json index faa6fb3bdc0..8aac19b5cda 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/tspCodeModel.json @@ -98,6 +98,11 @@ "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "TestModel" + } + }, "properties": [ { "$id": "10", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/tspCodeModel.json index df8d63cde3f..2d2f1189837 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/tspCodeModel.json @@ -304,6 +304,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV1", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV1" + } + }, "properties": [ { "$id": "32", @@ -402,6 +407,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV2" + } + }, "properties": [ { "$id": "40", @@ -539,6 +549,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV3" + } + }, "properties": [ { "$id": "52", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/tspCodeModel.json index 9dd9cddeb6c..9b8832713a2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/tspCodeModel.json @@ -224,6 +224,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV2" + } + }, "properties": [ { "$id": "22", @@ -322,6 +327,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV3" + } + }, "properties": [ { "$id": "30", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/tspCodeModel.json index 40019df445d..2d3141ed58e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/tspCodeModel.json @@ -273,6 +273,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV1", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV1" + } + }, "properties": [ { "$id": "29", @@ -371,6 +376,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV2" + } + }, "properties": [ { "$id": "37", @@ -508,6 +518,11 @@ "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "ModelV3" + } + }, "properties": [ { "$id": "49", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/tspCodeModel.json index f1e31875a3d..f441bfe465b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/tspCodeModel.json @@ -148,6 +148,11 @@ "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "OldModel" + } + }, "properties": [ { "$id": "16", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/tspCodeModel.json index 27bebbf4c98..dcc844a9d1b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/tspCodeModel.json @@ -163,6 +163,11 @@ "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "NewModel" + } + }, "properties": [ { "$id": "17", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/tspCodeModel.json index 8b09fae22ee..0a69f0e1074 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/tspCodeModel.json @@ -83,6 +83,11 @@ "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "TestModel" + } + }, "properties": [ { "$id": "9", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/tspCodeModel.json index c548a85c8ea..b14a7a2b324 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/tspCodeModel.json @@ -98,6 +98,11 @@ "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel", "usage": "Input,Output,Json", "decorators": [], + "serializationOptions": { + "json": { + "name": "TestModel" + } + }, "properties": [ { "$id": "10",