From 8ae3cd52eb16c9e082dec9c713d5cc75a4225df8 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Tue, 28 Apr 2020 12:29:22 -0700 Subject: [PATCH] [v6] Naming fixes (#625) * Add reserved words and make operationFullName consistent * Address pr comments * Update naming utils and remove unecessary serializedNames --- src/generators/clientFileGenerator.ts | 6 +- src/generators/operationGenerator.ts | 6 +- src/transforms/mapperTransforms.ts | 15 +- src/transforms/objectTransforms.ts | 24 +- src/transforms/operationTransforms.ts | 61 +++- src/transforms/parameterTransforms.ts | 33 +- src/transforms/transforms.ts | 8 +- src/utils/nameUtils.ts | 126 ++++++- src/utils/schemaHelpers.ts | 3 +- .../src/models/mappers.ts | 17 +- .../src/models/parameters.ts | 2 +- .../src/models/mappers.ts | 1 - .../src/models/parameters.ts | 2 +- .../azureReport/src/models/mappers.ts | 1 - .../generated/azureReport/src/reportClient.ts | 6 +- .../src/models/index.ts | 6 +- .../src/models/mappers.ts | 9 +- .../src/models/parameters.ts | 10 +- .../generated/bodyArray/src/models/mappers.ts | 2 - .../bodyArray/src/models/parameters.ts | 51 +-- .../bodyArray/src/operations/array.ts | 326 ++++-------------- .../bodyBoolean/src/models/mappers.ts | 1 - .../bodyBoolean/src/models/parameters.ts | 6 +- .../bodyBoolean/src/operations/bool.ts | 8 +- .../bodyBooleanQuirks/src/models/mappers.ts | 1 - .../src/models/parameters.ts | 2 +- .../bodyBooleanQuirks/src/operations/bool.ts | 8 +- .../generated/bodyByte/src/models/mappers.ts | 1 - .../bodyByte/src/models/parameters.ts | 2 +- .../generated/bodyByte/src/operations/byte.ts | 8 +- .../bodyComplex/src/models/mappers.ts | 41 +-- .../bodyComplex/src/models/parameters.ts | 4 +- .../generated/bodyDate/src/bodyDateClient.ts | 4 +- .../generated/bodyDate/src/models/index.ts | 12 +- .../generated/bodyDate/src/models/mappers.ts | 1 - .../bodyDate/src/models/parameters.ts | 2 +- .../generated/bodyDate/src/operations/date.ts | 56 ++- .../bodyDateTime/src/models/mappers.ts | 1 - .../bodyDateTime/src/models/parameters.ts | 2 +- .../bodyDateTime/src/operations/datetime.ts | 28 +- .../bodyDateTimeRfc1123/src/models/mappers.ts | 1 - .../src/models/parameters.ts | 2 +- .../src/operations/datetimerfc1123.ts | 35 +- .../bodyDictionary/src/models/mappers.ts | 2 - .../bodyDictionary/src/models/parameters.ts | 37 +- .../src/operations/dictionary.ts | 311 +++-------------- .../bodyDuration/src/models/mappers.ts | 1 - .../bodyDuration/src/models/parameters.ts | 2 +- .../bodyDuration/src/operations/duration.ts | 6 +- .../bodyInteger/src/models/mappers.ts | 1 - .../bodyInteger/src/models/parameters.ts | 2 +- .../bodyInteger/src/operations/int.ts | 18 +- .../bodyNumber/src/bodyNumberClient.ts | 4 +- .../bodyNumber/src/models/mappers.ts | 1 - .../bodyNumber/src/models/parameters.ts | 10 +- .../bodyNumber/src/operations/number.ts | 34 +- .../bodyString/src/bodyStringClient.ts | 4 +- .../bodyString/src/models/mappers.ts | 6 +- .../bodyString/src/models/parameters.ts | 8 +- .../bodyString/src/operations/enum.ts | 6 +- .../bodyString/src/operations/string.ts | 22 +- .../generated/bodyTime/src/models/mappers.ts | 1 - .../bodyTime/src/models/parameters.ts | 2 +- .../generated/bodyTime/src/operations/time.ts | 4 +- .../generated/customUrl/src/models/mappers.ts | 1 - .../generated/header/src/models/index.ts | 28 +- .../generated/header/src/models/mappers.ts | 15 - .../generated/lro/src/models/index.ts | 104 +++--- .../generated/lro/src/models/mappers.ts | 65 +--- .../generated/lro/src/models/parameters.ts | 2 +- .../mediaTypes/src/mediaTypesClient.ts | 4 +- .../mediaTypes/src/models/mappers.ts | 1 - .../mediaTypes/src/models/parameters.ts | 2 +- .../src/modelFlatteningClient.ts | 9 +- .../modelFlattening/src/models/mappers.ts | 19 +- .../modelFlattening/src/models/parameters.ts | 2 +- .../noMappers/src/noMappersClient.ts | 2 +- .../generated/paging/src/models/mappers.ts | 6 - .../generated/report/src/models/mappers.ts | 1 - .../generated/report/src/reportClient.ts | 12 +- .../generated/url/src/models/mappers.ts | 1 - .../generated/url/src/models/parameters.ts | 80 ++--- .../generated/xmlservice/src/models/index.ts | 2 +- .../xmlservice/src/models/mappers.ts | 36 +- .../xmlservice/src/models/parameters.ts | 14 +- test/unit/transforms/mapperTransforms.spec.ts | 73 ++-- .../transforms/operationTransforms.spec.ts | 21 +- .../transforms/parameterTransforms.spec.ts | 14 +- 88 files changed, 728 insertions(+), 1209 deletions(-) diff --git a/src/generators/clientFileGenerator.ts b/src/generators/clientFileGenerator.ts index 928835a6a6..f2c92c6228 100644 --- a/src/generators/clientFileGenerator.ts +++ b/src/generators/clientFileGenerator.ts @@ -175,7 +175,11 @@ function getOperationGroupsDeclarationDetails( return operationGroups.map(og => { return { name: normalizeName(og.name, NameType.Property), - typeName: `operations.${normalizeName(og.name, NameType.Class)}` + typeName: `operations.${normalizeName( + og.name, + NameType.OperationGroup, + true /* shouldGuard */ + )}` }; }); } diff --git a/src/generators/operationGenerator.ts b/src/generators/operationGenerator.ts index e3b2565b19..ec70dcb821 100644 --- a/src/generators/operationGenerator.ts +++ b/src/generators/operationGenerator.ts @@ -326,7 +326,11 @@ function addClass( clientDetails: ClientDetails ) { let importedModels = new Set(); - const className = normalizeName(operationGroupDetails.name, NameType.Class); + const className = normalizeName( + operationGroupDetails.name, + NameType.OperationGroup, + true /** shouldGuard */ + ); const operationGroupClass = operationGroupFile.addClass({ name: className, docs: [`Class representing a ${className}.`], diff --git a/src/transforms/mapperTransforms.ts b/src/transforms/mapperTransforms.ts index 27092db255..8010ebd9de 100644 --- a/src/transforms/mapperTransforms.ts +++ b/src/transforms/mapperTransforms.ts @@ -125,7 +125,8 @@ export function transformMapper({ schema, options }: MapperInput) { export function getMapperClassName(schema: Schema): string { return normalizeName( getLanguageMetadata(schema.language).name, - NameType.Class + NameType.Class, + true /** shouldGuard */ ); } @@ -153,7 +154,8 @@ function buildMapper( const serializedName = getDiscriminatorValue(schema) || options.serializedName || - getLanguageMetadata(schema.language).name; + // Fallback to name only for XML schemas since they need a name, otherwise don't + (options.hasXmlMetadata && getLanguageMetadata(schema.language).name); const arraySchema = schema as ArraySchema; arraySchema.elementType; @@ -528,8 +530,7 @@ function transformConstantMapper(pipelineValue: PipelineValue): PipelineValue { } const serializedName = (options && options.serializedName) || - getLanguageMetadata(schema.language).serializedName || - getLanguageMetadata(schema.language).name; + getLanguageMetadata(schema.language).serializedName; const constantSchema = schema as ConstantSchema; @@ -607,7 +608,11 @@ function processProperties( properties.forEach(prop => { const serializedName = getPropertySerializedName(prop); const propName = getLanguageMetadata(prop.language).name; - const name = normalizeName(propName, NameType.Property); + const name = normalizeName( + propName, + NameType.Property, + true /** shouldGuard */ + ); modelProperties[name] = getMapperOrRef(prop.schema, prop.serializedName, { ...options, required: prop.required, diff --git a/src/transforms/objectTransforms.ts b/src/transforms/objectTransforms.ts index 1a62accb0a..64721b9360 100644 --- a/src/transforms/objectTransforms.ts +++ b/src/transforms/objectTransforms.ts @@ -40,7 +40,11 @@ export function transformObject( uberParents: ObjectDetails[] ): ObjectDetails { const metadata = getLanguageMetadata(schema.language); - let name = normalizeName(metadata.name, NameType.Class); + let name = normalizeName( + metadata.name, + NameType.Class, + true /** shouldGuard */ + ); const kind = getObjectKind(schema); let objectDetails: ObjectDetails = { @@ -72,7 +76,11 @@ export function transformProperty({ const { typeName, isConstant, defaultValue } = typeDetails; return { - name: normalizeName(metadata.name, NameType.Property), + name: normalizeName( + metadata.name, + NameType.Property, + true /** shouldGuard */ + ), description: !metadata.description.startsWith("MISSING") ? metadata.description : undefined, @@ -144,7 +152,8 @@ function extractHierarchy( .map(r => { const relativeName = normalizeName( getLanguageMetadata(r.language).name, - NameType.Interface + NameType.Interface, + true /** shouldGuard */ ); const relative = objectsDetails.find(o => o.name === relativeName); @@ -188,7 +197,11 @@ function transformComposedObject( const parentNames = schema.parents.immediate.map(parent => { const name = getLanguageMetadata(parent.language).name; - return `${normalizeName(name, NameType.Interface)}`; + return `${normalizeName( + name, + NameType.Interface, + true /** shouldGuard */ + )}`; }); return { @@ -209,7 +222,8 @@ function transformPolymorphicObject( // TODO: Reconsider names to reduce issues with normalization, can we switch to serialized? const name = normalizeName( getLanguageMetadata(p.language).name, - NameType.Interface + NameType.Interface, + true /** shouldGuard */ ); return uberParents.some(up => up.name === name); }); diff --git a/src/transforms/operationTransforms.ts b/src/transforms/operationTransforms.ts index cbe7d01385..4d9c888a45 100644 --- a/src/transforms/operationTransforms.ts +++ b/src/transforms/operationTransforms.ts @@ -15,7 +15,11 @@ import { ConstantSchema, CodeModel } from "@azure-tools/codemodel"; -import { normalizeName, NameType } from "../utils/nameUtils"; +import { + normalizeName, + NameType, + getOperationFullName +} from "../utils/nameUtils"; import { OperationGroupDetails, OperationDetails, @@ -86,7 +90,11 @@ export function transformOperationSpec( operationDetails: OperationDetails, parameters: ParameterDetails[] ): OperationSpecDetails[] { - const operationName = normalizeName(operationDetails.name, NameType.Property); + const operationName = normalizeName( + operationDetails.name, + NameType.Operation, + true /** shouldGuard */ + ); // Extract protocol information const operationFullName = operationDetails.fullName; @@ -190,7 +198,11 @@ export function getSpecType(responseSchema: Schema, expand = false): SpecType { break; case SchemaType.Object: const name = getLanguageMetadata(responseSchema.language).name; - reference = `Mappers.${normalizeName(name, NameType.Class)}`; + reference = `Mappers.${normalizeName( + name, + NameType.Class, + true /** shouldGuard */ + )}`; break; default: typeName = getMapperTypeFromSchema(responseSchema.type); @@ -290,20 +302,33 @@ export function transformOperationResponse( export async function transformOperation( operation: Operation, - operationGroupName: string + operationGroup: OperationGroup, + clientName: string ): Promise { const metadata = getLanguageMetadata(operation.language); const pagination = extractPaginationDetails(operation); - const name = normalizeName(metadata.name, NameType.Property); - const operationFullName = `${operationGroupName}_${name}`; + const name = normalizeName( + metadata.name, + NameType.Operation, + true /** shouldGuard */ + ); + const operationFullName = getOperationFullName( + operationGroup, + operation, + clientName + ); const responsesAndErrors = [ ...(operation.responses || []), ...(operation.exceptions || []) ]; const typeName = `${normalizeName( - operationGroupName, + getOperationGroupName(operationGroup, clientName), NameType.Interface - )}${normalizeName(metadata.name, NameType.Interface)}`; + )}${normalizeName( + metadata.name, + NameType.Interface, + true /** shouldGuard */ + )}`; const typeDetails: TypeDetails = { typeName, @@ -347,7 +372,7 @@ export async function transformOperation( return { name, typeDetails, - fullName: operationFullName.toLowerCase(), + fullName: operationFullName, apiVersions: operation.apiVersions ? operation.apiVersions.map(v => v.version) : [], @@ -372,23 +397,35 @@ export function transformOperationGroups( ); } +function getOperationGroupName( + operationGroup: OperationGroup, + clientName: string = "" +) { + const { name } = getLanguageMetadata(operationGroup.language); + + return normalizeName(name || clientName, NameType.OperationGroup); +} + export async function transformOperationGroup( operationGroup: OperationGroup, clientName: string ): Promise { const metadata = getLanguageMetadata(operationGroup.language); const isTopLevel = !metadata.name; - const name = normalizeName(metadata.name || clientName, NameType.Property); + const operationGroupClassName = getOperationGroupName( + operationGroup, + clientName + ); const operations = await Promise.all( operationGroup.operations.map(operation => - transformOperation(operation, name) + transformOperation(operation, operationGroup, clientName) ) ); const mediaTypes = getOperationGroupMediaTypes(operations); return { - name, + name: operationGroupClassName, key: operationGroup.$key, operations, isTopLevel, diff --git a/src/transforms/parameterTransforms.ts b/src/transforms/parameterTransforms.ts index 374c933ade..581ffb9fce 100644 --- a/src/transforms/parameterTransforms.ts +++ b/src/transforms/parameterTransforms.ts @@ -13,7 +13,11 @@ import { } from "@azure-tools/codemodel"; import { QueryCollectionFormat } from "@azure/core-http"; import { getLanguageMetadata } from "../utils/languageHelpers"; -import { normalizeName, NameType } from "../utils/nameUtils"; +import { + normalizeName, + NameType, + getOperationFullName +} from "../utils/nameUtils"; import { ParameterDetails } from "../models/parameterDetails"; import { isSchemaType, @@ -111,13 +115,11 @@ export function transformParameters( const extractOperationParameters = (codeModel: CodeModel) => codeModel.operationGroups.reduce((acc, og) => { const clientName = getLanguageMetadata(codeModel.language).name; - const groupName = getLanguageMetadata(og.language).name || clientName; return [ ...acc, ...og.operations.reduce( (operations, operation) => { - const opName = getLanguageMetadata(operation.language).name; - const operationName = `${groupName}_${opName}`.toLowerCase(); + const operationName = getOperationFullName(og, operation, clientName); // Look for request in old 'request' property if new 'requests' doesn't exist const requests = operation.requests; @@ -200,7 +202,11 @@ export function populateOperationParameters( return; } - const name = normalizeName(parameterName, NameType.Property); + const name = normalizeName( + parameterName, + NameType.Parameter, + true /** shouldGuard */ + ); const serializedName = getLanguageMetadata(parameter.language).serializedName || name; const sameNameParams = operationParameters.filter(p => p.name === name); @@ -275,12 +281,19 @@ function getIsGlobal(parameter: Parameter) { function getParameterPath(parameter: Parameter) { const metadata = getLanguageMetadata(parameter.language); // ParameterPath has to include the name we used for the parameter, not the serializedName - const name = normalizeName(metadata.name, NameType.Property); + const name = normalizeName( + metadata.name, + NameType.Parameter, + true /** shouldGuard */ + ); if (parameter.groupedBy) { const groupedByName = getLanguageMetadata(parameter.groupedBy.language) .name; - return [normalizeName(groupedByName, NameType.Property), name]; + return [ + normalizeName(groupedByName, NameType.Parameter, true /** shouldGuard */), + name + ]; } return isClientImplementation(parameter) || parameter.required @@ -383,7 +396,11 @@ export function disambiguateParameter( return; } else { // Since there is already a parameter with the same name, we need to ad a sufix - const name = normalizeName(serializedName, NameType.Property); + const name = normalizeName( + serializedName, + NameType.Parameter, + true /** shouldGuard */ + ); const nameRef = `${name}${sameNameParams.length}`; const collectionFormat = getCollectionFormat(parameter); let description = diff --git a/src/transforms/transforms.ts b/src/transforms/transforms.ts index f598315efb..6c1a44aff7 100644 --- a/src/transforms/transforms.ts +++ b/src/transforms/transforms.ts @@ -41,7 +41,7 @@ export function transformChoice( choice: ChoiceSchema | SealedChoiceSchema ): UnionDetails { const metadata = getLanguageMetadata(choice.language); - let name = guardReservedNames(metadata.name); + let name = normalizeName(metadata.name, NameType.Interface); return { name, @@ -57,7 +57,11 @@ export async function transformCodeModel( codeModel: CodeModel, host: Host ): Promise { - const className = normalizeName(codeModel.info.title, NameType.Class); + const className = normalizeName( + codeModel.info.title, + NameType.Class, + true /** shouldGuard */ + ); normalizeModelWithExtensions(codeModel); const [uberParents, operationGroups] = await Promise.all([ diff --git a/src/utils/nameUtils.ts b/src/utils/nameUtils.ts index d1a932779f..1e43757c35 100644 --- a/src/utils/nameUtils.ts +++ b/src/utils/nameUtils.ts @@ -4,22 +4,117 @@ import { Operation, OperationGroup } from "@azure-tools/codemodel"; import { getLanguageMetadata } from "./languageHelpers"; import { TypeDetails, PropertyKind } from "../models/modelDetails"; -const ReservedModelNames = ["Error", "Date"]; - -export enum CasingConvention { - Pascal, - Camel +interface ReservedName { + name: string; + reservedFor: NameType[]; } export enum NameType { Class, File, Interface, - Property + Property, + Parameter, + Operation, + OperationGroup +} + +const Newable = [NameType.Class, NameType.Interface, NameType.OperationGroup]; + +const ReservedModelNames: ReservedName[] = [ + { name: "any", reservedFor: [NameType.Parameter] }, + { name: "as", reservedFor: [NameType.Parameter] }, + { name: "boolean", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "break", reservedFor: [NameType.Parameter] }, + { name: "case", reservedFor: [NameType.Parameter] }, + { name: "catch", reservedFor: [NameType.Parameter] }, + { name: "class", reservedFor: [NameType.Parameter] }, + { name: "const", reservedFor: [NameType.Parameter] }, + { name: "constructor", reservedFor: [NameType.Parameter] }, + { name: "continue", reservedFor: [NameType.Parameter] }, + { name: "date", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "debugger", reservedFor: [NameType.Parameter] }, + { name: "declare", reservedFor: [NameType.Parameter] }, + { name: "default", reservedFor: [NameType.Parameter] }, + { name: "delete", reservedFor: [NameType.Parameter] }, + { name: "do", reservedFor: [NameType.Parameter] }, + { name: "else", reservedFor: [NameType.Parameter] }, + { name: "enum", reservedFor: [NameType.Parameter] }, + { name: "error", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "export", reservedFor: [NameType.Parameter] }, + { name: "extends", reservedFor: [NameType.Parameter] }, + { name: "false", reservedFor: [NameType.Parameter] }, + { name: "finally", reservedFor: [NameType.Parameter] }, + { name: "for", reservedFor: [NameType.Parameter] }, + { name: "from", reservedFor: [NameType.Parameter] }, + { name: "function", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "get", reservedFor: [NameType.Parameter] }, + { name: "if", reservedFor: [NameType.Parameter] }, + { name: "implements", reservedFor: [NameType.Parameter] }, + { name: "import", reservedFor: [NameType.Parameter] }, + { name: "in", reservedFor: [NameType.Parameter] }, + { name: "instanceof", reservedFor: [NameType.Parameter] }, + { name: "interface", reservedFor: [NameType.Parameter] }, + { name: "let", reservedFor: [NameType.Parameter] }, + { name: "module", reservedFor: [NameType.Parameter] }, + { name: "new", reservedFor: [NameType.Parameter] }, + { name: "null", reservedFor: [NameType.Parameter] }, + { name: "number", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "of", reservedFor: [NameType.Parameter] }, + { name: "package", reservedFor: [NameType.Parameter] }, + { name: "private", reservedFor: [NameType.Parameter] }, + { name: "protected", reservedFor: [NameType.Parameter] }, + { name: "public", reservedFor: [NameType.Parameter] }, + { name: "require", reservedFor: [NameType.Parameter] }, + { name: "return", reservedFor: [NameType.Parameter] }, + { name: "set", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "static", reservedFor: [NameType.Parameter] }, + { name: "string", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "super", reservedFor: [NameType.Parameter] }, + { name: "switch", reservedFor: [NameType.Parameter] }, + { name: "symbol", reservedFor: [NameType.Parameter, ...Newable] }, + { name: "this", reservedFor: [NameType.Parameter] }, + { name: "throw", reservedFor: [NameType.Parameter] }, + { name: "true", reservedFor: [NameType.Parameter] }, + { name: "try", reservedFor: [NameType.Parameter] }, + { name: "type", reservedFor: [NameType.Parameter] }, + { name: "typeof", reservedFor: [NameType.Parameter] }, + { name: "var", reservedFor: [NameType.Parameter] }, + { name: "void", reservedFor: [NameType.Parameter] }, + { name: "while", reservedFor: [NameType.Parameter] }, + { name: "with", reservedFor: [NameType.Parameter] }, + { name: "yield", reservedFor: [NameType.Parameter] } +]; + +export enum CasingConvention { + Pascal, + Camel +} + +export function guardReservedNames(name: string, nameType: NameType): string { + const suffix = getSuffix(nameType); + return ReservedModelNames.filter(r => r.reservedFor.includes(nameType)).find( + r => r.name === name.toLowerCase() + ) + ? `${name}${suffix}` + : name; } -export function guardReservedNames(name: string): string { - return ReservedModelNames.indexOf(name) > -1 ? `${name}Model` : name; +function getSuffix(nameType?: NameType) { + switch (nameType) { + case NameType.File: + case NameType.Operation: + case NameType.Property: + return ""; + case NameType.OperationGroup: + return "Operations"; + case NameType.Parameter: + return "Param"; + case NameType.Class: + case NameType.Interface: + default: + return "Model"; + } } /** @@ -36,7 +131,11 @@ export function normalizeTypeName({ kind, typeName }: TypeDetails) { return typeName; } -export function normalizeName(name: string, nameType: NameType): string { +export function normalizeName( + name: string, + nameType: NameType, + shouldGuard?: boolean +): string { const casingConvention = getCasingConvention(nameType); let parts = getNameParts(name); @@ -47,7 +146,7 @@ export function normalizeName(name: string, nameType: NameType): string { .join(""); const normalized = `${normalizedFirstPart}${normalizedParts}`; - return guardReservedNames(normalized); + return shouldGuard ? guardReservedNames(normalized, nameType) : normalized; } export function getModelsName(title: string): string { @@ -64,9 +163,12 @@ function getCasingConvention(nameType: NameType) { switch (nameType) { case NameType.Class: case NameType.Interface: + case NameType.OperationGroup: return CasingConvention.Pascal; case NameType.File: case NameType.Property: + case NameType.Operation: + case NameType.Parameter: return CasingConvention.Camel; } } @@ -102,11 +204,11 @@ export function getOperationFullName( ) { const groupName = normalizeName( getLanguageMetadata(operationGroup.language).name || clientName, - NameType.Property + NameType.OperationGroup ); const operationName = normalizeName( getLanguageMetadata(operation.language).name, - NameType.Property + NameType.Operation ); return `${groupName}_${operationName}`; diff --git a/src/utils/schemaHelpers.ts b/src/utils/schemaHelpers.ts index 2444b27444..6d2dae56eb 100644 --- a/src/utils/schemaHelpers.ts +++ b/src/utils/schemaHelpers.ts @@ -97,7 +97,8 @@ export function getTypeForSchema(schema: Schema): TypeDetails { const objSchema = schema as ObjectSchema; const name = normalizeName( getLanguageMetadata(schema.language).name, - NameType.Interface + NameType.Interface, + true /** shouldGuard */ ); // Polymorphic objects with children will get a union type as type diff --git a/test/integration/generated/additionalProperties/src/models/mappers.ts b/test/integration/generated/additionalProperties/src/models/mappers.ts index 99676f8c41..d9dd0dc742 100644 --- a/test/integration/generated/additionalProperties/src/models/mappers.ts +++ b/test/integration/generated/additionalProperties/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const PetAPTrue: coreHttp.CompositeMapper = { - serializedName: "PetAPTrue", type: { name: "Composite", className: "PetAPTrue", @@ -27,7 +26,6 @@ export const PetAPTrue: coreHttp.CompositeMapper = { }; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -39,7 +37,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const CatAPTrue: coreHttp.CompositeMapper = { - serializedName: "CatAPTrue", type: { name: "Composite", className: "CatAPTrue", @@ -52,7 +49,6 @@ export const CatAPTrue: coreHttp.CompositeMapper = { }; export const PetAPObject: coreHttp.CompositeMapper = { - serializedName: "PetAPObject", type: { name: "Composite", className: "PetAPObject", @@ -70,7 +66,6 @@ export const PetAPObject: coreHttp.CompositeMapper = { }; export const PetAPString: coreHttp.CompositeMapper = { - serializedName: "PetAPString", type: { name: "Composite", className: "PetAPString", @@ -88,7 +83,6 @@ export const PetAPString: coreHttp.CompositeMapper = { }; export const PetAPInProperties: coreHttp.CompositeMapper = { - serializedName: "PetAPInProperties", type: { name: "Composite", className: "PetAPInProperties", @@ -101,10 +95,7 @@ export const PetAPInProperties: coreHttp.CompositeMapper = { readOnly: true }, additionalProperties: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, + type: { name: "Dictionary", value: { type: { name: "Number" } } }, serializedName: "additionalProperties" } } @@ -112,7 +103,6 @@ export const PetAPInProperties: coreHttp.CompositeMapper = { }; export const PetAPInPropertiesWithAPString: coreHttp.CompositeMapper = { - serializedName: "PetAPInPropertiesWithAPString", type: { name: "Composite", className: "PetAPInPropertiesWithAPString", @@ -131,10 +121,7 @@ export const PetAPInPropertiesWithAPString: coreHttp.CompositeMapper = { required: true }, additionalProperties: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, + type: { name: "Dictionary", value: { type: { name: "Number" } } }, serializedName: "additionalProperties" } } diff --git a/test/integration/generated/additionalProperties/src/models/parameters.ts b/test/integration/generated/additionalProperties/src/models/parameters.ts index 82bb83b502..b365e65148 100644 --- a/test/integration/generated/additionalProperties/src/models/parameters.ts +++ b/test/integration/generated/additionalProperties/src/models/parameters.ts @@ -13,8 +13,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/azureParameterGrouping/src/models/mappers.ts b/test/integration/generated/azureParameterGrouping/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/azureParameterGrouping/src/models/mappers.ts +++ b/test/integration/generated/azureParameterGrouping/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/azureParameterGrouping/src/models/parameters.ts b/test/integration/generated/azureParameterGrouping/src/models/parameters.ts index c4ca629d8a..f5fc2ea16b 100644 --- a/test/integration/generated/azureParameterGrouping/src/models/parameters.ts +++ b/test/integration/generated/azureParameterGrouping/src/models/parameters.ts @@ -13,8 +13,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/azureReport/src/models/mappers.ts b/test/integration/generated/azureReport/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/azureReport/src/models/mappers.ts +++ b/test/integration/generated/azureReport/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/azureReport/src/reportClient.ts b/test/integration/generated/azureReport/src/reportClient.ts index 3d54862279..1105be2395 100644 --- a/test/integration/generated/azureReport/src/reportClient.ts +++ b/test/integration/generated/azureReport/src/reportClient.ts @@ -51,11 +51,7 @@ const getReportOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { diff --git a/test/integration/generated/azureSpecialProperties/src/models/index.ts b/test/integration/generated/azureSpecialProperties/src/models/index.ts index db41b8b4be..e3343d630c 100644 --- a/test/integration/generated/azureSpecialProperties/src/models/index.ts +++ b/test/integration/generated/azureSpecialProperties/src/models/index.ts @@ -20,21 +20,21 @@ export interface OdataFilter { } /** - * Defines headers for header_customNamedRequestId operation. + * Defines headers for Header_customNamedRequestId operation. */ export interface HeaderCustomNamedRequestIdHeaders { fooRequestId?: string; } /** - * Defines headers for header_customNamedRequestIdParamGrouping operation. + * Defines headers for Header_customNamedRequestIdParamGrouping operation. */ export interface HeaderCustomNamedRequestIdParamGroupingHeaders { fooRequestId?: string; } /** - * Defines headers for header_customNamedRequestIdHead operation. + * Defines headers for Header_customNamedRequestIdHead operation. */ export interface HeaderCustomNamedRequestIdHeadHeaders { fooRequestId?: string; diff --git a/test/integration/generated/azureSpecialProperties/src/models/mappers.ts b/test/integration/generated/azureSpecialProperties/src/models/mappers.ts index 9276bfe03c..6364f8afb9 100644 --- a/test/integration/generated/azureSpecialProperties/src/models/mappers.ts +++ b/test/integration/generated/azureSpecialProperties/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -17,9 +16,9 @@ export const ErrorModel: coreHttp.CompositeMapper = { status: { type: { name: "Number" }, serializedName: "status" }, constantId: { type: { name: "Number" }, - serializedName: "constantId", defaultValue: 1, - isConstant: true + isConstant: true, + serializedName: "constantId" }, message: { type: { name: "String" }, serializedName: "message" } } @@ -27,7 +26,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const OdataFilter: coreHttp.CompositeMapper = { - serializedName: "OdataFilter", type: { name: "Composite", className: "OdataFilter", @@ -39,7 +37,6 @@ export const OdataFilter: coreHttp.CompositeMapper = { }; export const HeaderCustomNamedRequestIdHeaders: coreHttp.CompositeMapper = { - serializedName: "header_customNamedRequestIdHeaders", type: { name: "Composite", className: "HeaderCustomNamedRequestIdHeaders", @@ -53,7 +50,6 @@ export const HeaderCustomNamedRequestIdHeaders: coreHttp.CompositeMapper = { }; export const HeaderCustomNamedRequestIdParamGroupingHeaders: coreHttp.CompositeMapper = { - serializedName: "header_customNamedRequestIdParamGroupingHeaders", type: { name: "Composite", className: "HeaderCustomNamedRequestIdParamGroupingHeaders", @@ -67,7 +63,6 @@ export const HeaderCustomNamedRequestIdParamGroupingHeaders: coreHttp.CompositeM }; export const HeaderCustomNamedRequestIdHeadHeaders: coreHttp.CompositeMapper = { - serializedName: "header_customNamedRequestIdHeadHeaders", type: { name: "Composite", className: "HeaderCustomNamedRequestIdHeadHeaders", diff --git a/test/integration/generated/azureSpecialProperties/src/models/parameters.ts b/test/integration/generated/azureSpecialProperties/src/models/parameters.ts index 62d882871b..7707eaef7f 100644 --- a/test/integration/generated/azureSpecialProperties/src/models/parameters.ts +++ b/test/integration/generated/azureSpecialProperties/src/models/parameters.ts @@ -47,8 +47,8 @@ export const apiVersion: coreHttp.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2015-07-01-preview", - serializedName: "api-version", isConstant: true, + serializedName: "api-version", type: { name: "String" } @@ -103,8 +103,8 @@ export const apiVersion1: coreHttp.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2.0", - serializedName: "api-version", isConstant: true, + serializedName: "api-version", type: { name: "String" } @@ -125,8 +125,8 @@ export const apiVersion3: coreHttp.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2.0", - serializedName: "api-version", isConstant: true, + serializedName: "api-version", type: { name: "String" } @@ -149,8 +149,8 @@ export const unencodedPathParam1: coreHttp.OperationURLParameter = { parameterPath: "unencodedPathParam", mapper: { defaultValue: "path1/path2/path3", - serializedName: "unencodedPathParam", isConstant: true, + serializedName: "unencodedPathParam", type: { name: "String" } @@ -185,8 +185,8 @@ export const q12: coreHttp.OperationQueryParameter = { parameterPath: "q1", mapper: { defaultValue: "value1&q2=value2&q3=value3", - serializedName: "q1", isConstant: true, + serializedName: "q1", type: { name: "String" } diff --git a/test/integration/generated/bodyArray/src/models/mappers.ts b/test/integration/generated/bodyArray/src/models/mappers.ts index aa12c08bd2..eaa4c8bd35 100644 --- a/test/integration/generated/bodyArray/src/models/mappers.ts +++ b/test/integration/generated/bodyArray/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -21,7 +20,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const Product: coreHttp.CompositeMapper = { - serializedName: "Product", type: { name: "Composite", className: "Product", diff --git a/test/integration/generated/bodyArray/src/models/parameters.ts b/test/integration/generated/bodyArray/src/models/parameters.ts index ab1f0cf102..299d54d0da 100644 --- a/test/integration/generated/bodyArray/src/models/parameters.ts +++ b/test/integration/generated/bodyArray/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -40,10 +40,7 @@ export const arrayBody: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "PutContentSchemaItem" - } + element: { type: { name: "String" } } } } }; @@ -55,7 +52,7 @@ export const arrayBody1: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Boolean" }, serializedName: "Boolean" } + element: { type: { name: "Boolean" } } } } }; @@ -67,7 +64,7 @@ export const arrayBody2: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } + element: { type: { name: "Number" } } } } }; @@ -79,7 +76,7 @@ export const arrayBody3: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } + element: { type: { name: "Number" } } } } }; @@ -91,7 +88,7 @@ export const arrayBody4: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } + element: { type: { name: "Number" } } } } }; @@ -103,7 +100,7 @@ export const arrayBody5: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } + element: { type: { name: "Number" } } } } }; @@ -115,7 +112,7 @@ export const arrayBody6: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } } }; @@ -128,8 +125,7 @@ export const arrayBody7: coreHttp.OperationParameter = { type: { name: "Sequence", element: { - type: { name: "Enum", allowedValues: ["foo1", "foo2", "foo3"] }, - serializedName: "FooEnum" + type: { name: "Enum", allowedValues: ["foo1", "foo2", "foo3"] } } } } @@ -142,7 +138,7 @@ export const arrayBody8: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "Enum1" } + element: { type: { name: "String" } } } } }; @@ -154,7 +150,7 @@ export const arrayBody9: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Uuid" }, serializedName: "Uuid" } + element: { type: { name: "Uuid" } } } } }; @@ -166,7 +162,7 @@ export const arrayBody10: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "Date" }, serializedName: "Date" } + element: { type: { name: "Date" } } } } }; @@ -178,7 +174,7 @@ export const arrayBody11: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "DateTime" }, serializedName: "DateTime" } + element: { type: { name: "DateTime" } } } } }; @@ -190,7 +186,7 @@ export const arrayBody12: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "DateTimeRfc1123" }, serializedName: "DateTime" } + element: { type: { name: "DateTimeRfc1123" } } } } }; @@ -202,7 +198,7 @@ export const arrayBody13: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "TimeSpan" }, serializedName: "Duration" } + element: { type: { name: "TimeSpan" } } } } }; @@ -214,7 +210,7 @@ export const arrayBody14: coreHttp.OperationParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + element: { type: { name: "ByteArray" } } } } }; @@ -239,14 +235,7 @@ export const arrayBody16: coreHttp.OperationParameter = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "PutContentSchemaItemsItem" - } - }, - serializedName: "ArrayOfPutContentSchemaItemsItem" + type: { name: "Sequence", element: { type: { name: "String" } } } } } } @@ -260,11 +249,7 @@ export const arrayBody17: coreHttp.OperationParameter = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } } } diff --git a/test/integration/generated/bodyArray/src/operations/array.ts b/test/integration/generated/bodyArray/src/operations/array.ts index 0d6b034ec1..bb55f7eef7 100644 --- a/test/integration/generated/bodyArray/src/operations/array.ts +++ b/test/integration/generated/bodyArray/src/operations/array.ts @@ -1252,14 +1252,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Number" }, - serializedName: "Get200ApplicationJsonItemsItem" - } - }, - serializedName: "ArrayOfGet200ApplicationJsonItemsItem" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1275,11 +1268,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1295,11 +1284,7 @@ const getEmptyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1329,11 +1314,7 @@ const getBooleanTfftOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "ArrayOfBoolean" + type: { name: "Sequence", element: { type: { name: "Boolean" } } } } }, default: { @@ -1363,11 +1344,7 @@ const getBooleanInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "ArrayOfBoolean" + type: { name: "Sequence", element: { type: { name: "Boolean" } } } } }, default: { @@ -1383,11 +1360,7 @@ const getBooleanInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "ArrayOfBoolean" + type: { name: "Sequence", element: { type: { name: "Boolean" } } } } }, default: { @@ -1403,11 +1376,7 @@ const getIntegerValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1437,11 +1406,7 @@ const getIntInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1457,11 +1422,7 @@ const getIntInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1477,11 +1438,7 @@ const getLongValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1511,11 +1468,7 @@ const getLongInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1531,11 +1484,7 @@ const getLongInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "ArrayOfInteger" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1551,11 +1500,7 @@ const getFloatValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1585,11 +1530,7 @@ const getFloatInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1605,11 +1546,7 @@ const getFloatInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1625,11 +1562,7 @@ const getDoubleValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1659,11 +1592,7 @@ const getDoubleInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1679,11 +1608,7 @@ const getDoubleInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "ArrayOfNumber" + type: { name: "Sequence", element: { type: { name: "Number" } } } } }, default: { @@ -1699,11 +1624,7 @@ const getStringValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } }, default: { @@ -1736,11 +1657,9 @@ const getEnumValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { name: "Enum", allowedValues: ["foo1", "foo2", "foo3"] }, - serializedName: "FooEnum" + type: { name: "Enum", allowedValues: ["foo1", "foo2", "foo3"] } } - }, - serializedName: "ArrayOfFooEnum" + } } }, default: { @@ -1770,11 +1689,7 @@ const getStringEnumValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "Enum0" } - }, - serializedName: "ArrayOfEnum0" + type: { name: "Sequence", element: { type: { name: "String" } } } } }, default: { @@ -1804,11 +1719,7 @@ const getStringWithNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } }, default: { @@ -1824,11 +1735,7 @@ const getStringWithInvalidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } }, default: { @@ -1844,11 +1751,7 @@ const getUuidValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Uuid" }, serializedName: "Uuid" } - }, - serializedName: "ArrayOfUuid" + type: { name: "Sequence", element: { type: { name: "Uuid" } } } } }, default: { @@ -1878,11 +1781,7 @@ const getUuidInvalidCharsOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Uuid" }, serializedName: "Uuid" } - }, - serializedName: "ArrayOfUuid" + type: { name: "Sequence", element: { type: { name: "Uuid" } } } } }, default: { @@ -1898,11 +1797,7 @@ const getDateValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "ArrayOfDate" + type: { name: "Sequence", element: { type: { name: "Date" } } } } }, default: { @@ -1932,11 +1827,7 @@ const getDateInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "ArrayOfDate" + type: { name: "Sequence", element: { type: { name: "Date" } } } } }, default: { @@ -1952,11 +1843,7 @@ const getDateInvalidCharsOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "ArrayOfDate" + type: { name: "Sequence", element: { type: { name: "Date" } } } } }, default: { @@ -1972,11 +1859,7 @@ const getDateTimeValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "ArrayOfDateTime" + type: { name: "Sequence", element: { type: { name: "DateTime" } } } } }, default: { @@ -2006,11 +1889,7 @@ const getDateTimeInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "ArrayOfDateTime" + type: { name: "Sequence", element: { type: { name: "DateTime" } } } } }, default: { @@ -2026,11 +1905,7 @@ const getDateTimeInvalidCharsOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "ArrayOfDateTime" + type: { name: "Sequence", element: { type: { name: "DateTime" } } } } }, default: { @@ -2048,12 +1923,8 @@ const getDateTimeRfc1123ValidOperationSpec: coreHttp.OperationSpec = { bodyMapper: { type: { name: "Sequence", - element: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } - }, - serializedName: "ArrayOfDateTime" + element: { type: { name: "DateTimeRfc1123" } } + } } }, default: { @@ -2083,11 +1954,7 @@ const getDurationValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "TimeSpan" }, serializedName: "Duration" } - }, - serializedName: "ArrayOfDuration" + type: { name: "Sequence", element: { type: { name: "TimeSpan" } } } } }, default: { @@ -2117,11 +1984,7 @@ const getByteValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "ByteArray" }, serializedName: "ByteArray" } - }, - serializedName: "ArrayOfByteArray" + type: { name: "Sequence", element: { type: { name: "ByteArray" } } } } }, default: { @@ -2151,11 +2014,7 @@ const getByteInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "ByteArray" }, serializedName: "ByteArray" } - }, - serializedName: "ArrayOfByteArray" + type: { name: "Sequence", element: { type: { name: "ByteArray" } } } } }, default: { @@ -2171,11 +2030,7 @@ const getBase64UrlOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Sequence", - element: { type: { name: "Base64Url" }, serializedName: "ByteArray" } - }, - serializedName: "ArrayOfByteArray" + type: { name: "Sequence", element: { type: { name: "Base64Url" } } } } }, default: { @@ -2194,8 +2049,7 @@ const getComplexNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "Product" } } - }, - serializedName: "ArrayOfProduct" + } } }, default: { @@ -2214,8 +2068,7 @@ const getComplexEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "Product" } } - }, - serializedName: "ArrayOfProduct" + } } }, default: { @@ -2234,8 +2087,7 @@ const getComplexItemNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "Product" } } - }, - serializedName: "ArrayOfProduct" + } } }, default: { @@ -2254,8 +2106,7 @@ const getComplexItemEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "Product" } } - }, - serializedName: "ArrayOfProduct" + } } }, default: { @@ -2274,8 +2125,7 @@ const getComplexValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "Product" } } - }, - serializedName: "ArrayOfProduct" + } } }, default: { @@ -2308,14 +2158,9 @@ const getArrayNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfString" + } } }, default: { @@ -2334,14 +2179,9 @@ const getArrayEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfString" + } } }, default: { @@ -2360,14 +2200,9 @@ const getArrayItemNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfString" + } } }, default: { @@ -2386,14 +2221,9 @@ const getArrayItemEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfString" + } } }, default: { @@ -2412,14 +2242,9 @@ const getArrayValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfString" + } } }, default: { @@ -2452,14 +2277,9 @@ const getDictionaryNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfDictionaryOfString" + } } }, default: { @@ -2478,14 +2298,9 @@ const getDictionaryEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfDictionaryOfString" + } } }, default: { @@ -2504,14 +2319,9 @@ const getDictionaryItemNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfDictionaryOfString" + } } }, default: { @@ -2530,14 +2340,9 @@ const getDictionaryItemEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfDictionaryOfString" + } } }, default: { @@ -2556,14 +2361,9 @@ const getDictionaryValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } - }, - serializedName: "ArrayOfDictionaryOfString" + } } }, default: { diff --git a/test/integration/generated/bodyBoolean/src/models/mappers.ts b/test/integration/generated/bodyBoolean/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyBoolean/src/models/mappers.ts +++ b/test/integration/generated/bodyBoolean/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyBoolean/src/models/parameters.ts b/test/integration/generated/bodyBoolean/src/models/parameters.ts index 3b313fa430..e3a7be5fec 100644 --- a/test/integration/generated/bodyBoolean/src/models/parameters.ts +++ b/test/integration/generated/bodyBoolean/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -37,8 +37,8 @@ export const boolBody: coreHttp.OperationParameter = { parameterPath: "boolBody", mapper: { defaultValue: true, - serializedName: "boolBody", isConstant: true, + serializedName: "boolBody", type: { name: "Boolean" } @@ -49,8 +49,8 @@ export const boolBody1: coreHttp.OperationParameter = { parameterPath: "boolBody", mapper: { defaultValue: false, - serializedName: "boolBody", isConstant: true, + serializedName: "boolBody", type: { name: "Boolean" } diff --git a/test/integration/generated/bodyBoolean/src/operations/bool.ts b/test/integration/generated/bodyBoolean/src/operations/bool.ts index 96caf86da0..9a3fa5c363 100644 --- a/test/integration/generated/bodyBoolean/src/operations/bool.ts +++ b/test/integration/generated/bodyBoolean/src/operations/bool.ts @@ -128,7 +128,7 @@ const getTrueOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Bool" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -156,7 +156,7 @@ const getFalseOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Bool" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -184,7 +184,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -198,7 +198,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyBooleanQuirks/src/models/mappers.ts b/test/integration/generated/bodyBooleanQuirks/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/models/mappers.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyBooleanQuirks/src/models/parameters.ts b/test/integration/generated/bodyBooleanQuirks/src/models/parameters.ts index 89d27c0dc4..9727580b26 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/models/parameters.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts index d036697bb9..28cd941881 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts @@ -134,7 +134,7 @@ const getTrueOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -162,7 +162,7 @@ const getFalseOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -190,7 +190,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -204,7 +204,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Boolean" }, serializedName: "Boolean" } + bodyMapper: { type: { name: "Boolean" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyByte/src/models/mappers.ts b/test/integration/generated/bodyByte/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyByte/src/models/mappers.ts +++ b/test/integration/generated/bodyByte/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyByte/src/models/parameters.ts b/test/integration/generated/bodyByte/src/models/parameters.ts index 4974a51c7e..8d3b884dd8 100644 --- a/test/integration/generated/bodyByte/src/models/parameters.ts +++ b/test/integration/generated/bodyByte/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyByte/src/operations/byte.ts b/test/integration/generated/bodyByte/src/operations/byte.ts index 0ae979d7af..93574ed4b8 100644 --- a/test/integration/generated/bodyByte/src/operations/byte.ts +++ b/test/integration/generated/bodyByte/src/operations/byte.ts @@ -118,7 +118,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "ByteArray" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -132,7 +132,7 @@ const getEmptyOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "ByteArray" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -146,7 +146,7 @@ const getNonAsciiOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "ByteArray" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -174,7 +174,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "ByteArray" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyComplex/src/models/mappers.ts b/test/integration/generated/bodyComplex/src/models/mappers.ts index 4432a21012..4bf4ae57fd 100644 --- a/test/integration/generated/bodyComplex/src/models/mappers.ts +++ b/test/integration/generated/bodyComplex/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const Basic: coreHttp.CompositeMapper = { - serializedName: "Basic", type: { name: "Composite", className: "Basic", @@ -22,7 +21,6 @@ export const Basic: coreHttp.CompositeMapper = { }; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -34,7 +32,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const IntWrapper: coreHttp.CompositeMapper = { - serializedName: "IntWrapper", type: { name: "Composite", className: "IntWrapper", @@ -46,7 +43,6 @@ export const IntWrapper: coreHttp.CompositeMapper = { }; export const LongWrapper: coreHttp.CompositeMapper = { - serializedName: "LongWrapper", type: { name: "Composite", className: "LongWrapper", @@ -58,7 +54,6 @@ export const LongWrapper: coreHttp.CompositeMapper = { }; export const FloatWrapper: coreHttp.CompositeMapper = { - serializedName: "FloatWrapper", type: { name: "Composite", className: "FloatWrapper", @@ -70,7 +65,6 @@ export const FloatWrapper: coreHttp.CompositeMapper = { }; export const DoubleWrapper: coreHttp.CompositeMapper = { - serializedName: "DoubleWrapper", type: { name: "Composite", className: "DoubleWrapper", @@ -86,7 +80,6 @@ export const DoubleWrapper: coreHttp.CompositeMapper = { }; export const BooleanWrapper: coreHttp.CompositeMapper = { - serializedName: "BooleanWrapper", type: { name: "Composite", className: "BooleanWrapper", @@ -98,7 +91,6 @@ export const BooleanWrapper: coreHttp.CompositeMapper = { }; export const StringWrapper: coreHttp.CompositeMapper = { - serializedName: "StringWrapper", type: { name: "Composite", className: "StringWrapper", @@ -111,7 +103,6 @@ export const StringWrapper: coreHttp.CompositeMapper = { }; export const DateWrapper: coreHttp.CompositeMapper = { - serializedName: "DateWrapper", type: { name: "Composite", className: "DateWrapper", @@ -123,7 +114,6 @@ export const DateWrapper: coreHttp.CompositeMapper = { }; export const DatetimeWrapper: coreHttp.CompositeMapper = { - serializedName: "DatetimeWrapper", type: { name: "Composite", className: "DatetimeWrapper", @@ -135,7 +125,6 @@ export const DatetimeWrapper: coreHttp.CompositeMapper = { }; export const Datetimerfc1123Wrapper: coreHttp.CompositeMapper = { - serializedName: "Datetimerfc1123Wrapper", type: { name: "Composite", className: "Datetimerfc1123Wrapper", @@ -147,7 +136,6 @@ export const Datetimerfc1123Wrapper: coreHttp.CompositeMapper = { }; export const DurationWrapper: coreHttp.CompositeMapper = { - serializedName: "DurationWrapper", type: { name: "Composite", className: "DurationWrapper", @@ -158,7 +146,6 @@ export const DurationWrapper: coreHttp.CompositeMapper = { }; export const ByteWrapper: coreHttp.CompositeMapper = { - serializedName: "ByteWrapper", type: { name: "Composite", className: "ByteWrapper", @@ -169,19 +156,12 @@ export const ByteWrapper: coreHttp.CompositeMapper = { }; export const ArrayWrapper: coreHttp.CompositeMapper = { - serializedName: "ArrayWrapper", type: { name: "Composite", className: "ArrayWrapper", modelProperties: { array: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "ArrayWrapperArrayItem" - } - }, + type: { name: "Sequence", element: { type: { name: "String" } } }, serializedName: "array" } } @@ -189,16 +169,12 @@ export const ArrayWrapper: coreHttp.CompositeMapper = { }; export const DictionaryWrapper: coreHttp.CompositeMapper = { - serializedName: "DictionaryWrapper", type: { name: "Composite", className: "DictionaryWrapper", modelProperties: { defaultProgram: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, + type: { name: "Dictionary", value: { type: { name: "String" } } }, serializedName: "defaultProgram" } } @@ -206,7 +182,6 @@ export const DictionaryWrapper: coreHttp.CompositeMapper = { }; export const Pet: coreHttp.CompositeMapper = { - serializedName: "Pet", type: { name: "Composite", className: "Pet", @@ -218,7 +193,6 @@ export const Pet: coreHttp.CompositeMapper = { }; export const Cat: coreHttp.CompositeMapper = { - serializedName: "Cat", type: { name: "Composite", className: "Cat", @@ -237,7 +211,6 @@ export const Cat: coreHttp.CompositeMapper = { }; export const Dog: coreHttp.CompositeMapper = { - serializedName: "Dog", type: { name: "Composite", className: "Dog", @@ -249,7 +222,6 @@ export const Dog: coreHttp.CompositeMapper = { }; export const Siamese: coreHttp.CompositeMapper = { - serializedName: "Siamese", type: { name: "Composite", className: "Siamese", @@ -261,7 +233,6 @@ export const Siamese: coreHttp.CompositeMapper = { }; export const Fish: coreHttp.CompositeMapper = { - serializedName: "Fish", type: { name: "Composite", className: "Fish", @@ -294,7 +265,6 @@ export const Fish: coreHttp.CompositeMapper = { }; export const DotFish: coreHttp.CompositeMapper = { - serializedName: "DotFish", type: { name: "Composite", className: "DotFish", @@ -315,7 +285,6 @@ export const DotFish: coreHttp.CompositeMapper = { }; export const DotFishMarket: coreHttp.CompositeMapper = { - serializedName: "DotFishMarket", type: { name: "Composite", className: "DotFishMarket", @@ -380,7 +349,6 @@ export const Salmon: coreHttp.CompositeMapper = { }; export const ReadonlyObj: coreHttp.CompositeMapper = { - serializedName: "ReadonlyObj", type: { name: "Composite", className: "ReadonlyObj", @@ -392,7 +360,6 @@ export const ReadonlyObj: coreHttp.CompositeMapper = { }; export const MyBaseType: coreHttp.CompositeMapper = { - serializedName: "MyBaseType", type: { name: "Composite", className: "MyBaseType", @@ -404,9 +371,9 @@ export const MyBaseType: coreHttp.CompositeMapper = { modelProperties: { kind: { type: { name: "String" }, - serializedName: "kind", defaultValue: "Kind1", - isConstant: true + isConstant: true, + serializedName: "kind" }, propB1: { type: { name: "String" }, serializedName: "propB1" }, propBH1: { type: { name: "String" }, serializedName: "helper.propBH1" } diff --git a/test/integration/generated/bodyComplex/src/models/parameters.ts b/test/integration/generated/bodyComplex/src/models/parameters.ts index 2013c7f41c..d006e6afff 100644 --- a/test/integration/generated/bodyComplex/src/models/parameters.ts +++ b/test/integration/generated/bodyComplex/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -42,8 +42,8 @@ export const apiVersion: coreHttp.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { defaultValue: "2016-02-29", - serializedName: "api-version", isConstant: true, + serializedName: "api-version", type: { name: "String" } diff --git a/test/integration/generated/bodyDate/src/bodyDateClient.ts b/test/integration/generated/bodyDate/src/bodyDateClient.ts index f87db5aaa0..c98054aaac 100644 --- a/test/integration/generated/bodyDate/src/bodyDateClient.ts +++ b/test/integration/generated/bodyDate/src/bodyDateClient.ts @@ -18,10 +18,10 @@ class BodyDateClient extends BodyDateClientContext { */ constructor(options?: Models.BodyDateClientOptionalParams) { super(options); - this.date = new operations.DateModel(this); + this.date = new operations.DateOperations(this); } - date: operations.DateModel; + date: operations.DateOperations; } // Operation Specifications diff --git a/test/integration/generated/bodyDate/src/models/index.ts b/test/integration/generated/bodyDate/src/models/index.ts index e895179a2c..21677c4bcb 100644 --- a/test/integration/generated/bodyDate/src/models/index.ts +++ b/test/integration/generated/bodyDate/src/models/index.ts @@ -16,7 +16,7 @@ export interface ErrorModel { /** * Contains response data for the getNull operation. */ -export type DateModelGetNullResponse = { +export type DateGetNullResponse = { /** * The parsed response body. */ @@ -41,7 +41,7 @@ export type DateModelGetNullResponse = { /** * Contains response data for the getInvalidDate operation. */ -export type DateModelGetInvalidDateResponse = { +export type DateGetInvalidDateResponse = { /** * The parsed response body. */ @@ -66,7 +66,7 @@ export type DateModelGetInvalidDateResponse = { /** * Contains response data for the getOverflowDate operation. */ -export type DateModelGetOverflowDateResponse = { +export type DateGetOverflowDateResponse = { /** * The parsed response body. */ @@ -91,7 +91,7 @@ export type DateModelGetOverflowDateResponse = { /** * Contains response data for the getUnderflowDate operation. */ -export type DateModelGetUnderflowDateResponse = { +export type DateGetUnderflowDateResponse = { /** * The parsed response body. */ @@ -116,7 +116,7 @@ export type DateModelGetUnderflowDateResponse = { /** * Contains response data for the getMaxDate operation. */ -export type DateModelGetMaxDateResponse = { +export type DateGetMaxDateResponse = { /** * The parsed response body. */ @@ -141,7 +141,7 @@ export type DateModelGetMaxDateResponse = { /** * Contains response data for the getMinDate operation. */ -export type DateModelGetMinDateResponse = { +export type DateGetMinDateResponse = { /** * The parsed response body. */ diff --git a/test/integration/generated/bodyDate/src/models/mappers.ts b/test/integration/generated/bodyDate/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyDate/src/models/mappers.ts +++ b/test/integration/generated/bodyDate/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyDate/src/models/parameters.ts b/test/integration/generated/bodyDate/src/models/parameters.ts index c5de1e55ae..fd9a068f1d 100644 --- a/test/integration/generated/bodyDate/src/models/parameters.ts +++ b/test/integration/generated/bodyDate/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyDate/src/operations/date.ts b/test/integration/generated/bodyDate/src/operations/date.ts index 74746aa9c0..bca27529cb 100644 --- a/test/integration/generated/bodyDate/src/operations/date.ts +++ b/test/integration/generated/bodyDate/src/operations/date.ts @@ -11,22 +11,22 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BodyDateClient } from "../bodyDateClient"; import { - DateModelGetNullResponse, - DateModelGetInvalidDateResponse, - DateModelGetOverflowDateResponse, - DateModelGetUnderflowDateResponse, - DateModelGetMaxDateResponse, - DateModelGetMinDateResponse + DateGetNullResponse, + DateGetInvalidDateResponse, + DateGetOverflowDateResponse, + DateGetUnderflowDateResponse, + DateGetMaxDateResponse, + DateGetMinDateResponse } from "../models"; /** - * Class representing a DateModel. + * Class representing a DateOperations. */ -export class DateModel { +export class DateOperations { private readonly client: BodyDateClient; /** - * Initialize a new instance of the class DateModel class. + * Initialize a new instance of the class DateOperations class. * @param client Reference to the service client */ constructor(client: BodyDateClient) { @@ -37,16 +37,14 @@ export class DateModel { * Get null date value * @param options The options parameters. */ - getNull( - options?: coreHttp.OperationOptions - ): Promise { + getNull(options?: coreHttp.OperationOptions): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getNullOperationSpec - ) as Promise; + ) as Promise; } /** @@ -55,14 +53,14 @@ export class DateModel { */ getInvalidDate( options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getInvalidDateOperationSpec - ) as Promise; + ) as Promise; } /** @@ -71,14 +69,14 @@ export class DateModel { */ getOverflowDate( options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getOverflowDateOperationSpec - ) as Promise; + ) as Promise; } /** @@ -87,14 +85,14 @@ export class DateModel { */ getUnderflowDate( options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getUnderflowDateOperationSpec - ) as Promise; + ) as Promise; } /** @@ -121,14 +119,14 @@ export class DateModel { */ getMaxDate( options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getMaxDateOperationSpec - ) as Promise; + ) as Promise; } /** @@ -155,14 +153,14 @@ export class DateModel { */ getMinDate( options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( options || {} ); return this.client.sendOperationRequest( { options: operationOptions }, getMinDateOperationSpec - ) as Promise; + ) as Promise; } } // Operation Specifications @@ -174,7 +172,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -188,7 +186,7 @@ const getInvalidDateOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -202,7 +200,7 @@ const getOverflowDateOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -216,7 +214,7 @@ const getUnderflowDateOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -244,7 +242,7 @@ const getMaxDateOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -272,7 +270,7 @@ const getMinDateOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Date" }, serializedName: "Date" } + bodyMapper: { type: { name: "Date" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyDateTime/src/models/mappers.ts b/test/integration/generated/bodyDateTime/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyDateTime/src/models/mappers.ts +++ b/test/integration/generated/bodyDateTime/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyDateTime/src/models/parameters.ts b/test/integration/generated/bodyDateTime/src/models/parameters.ts index 8e73e59172..0139492199 100644 --- a/test/integration/generated/bodyDateTime/src/models/parameters.ts +++ b/test/integration/generated/bodyDateTime/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyDateTime/src/operations/datetime.ts b/test/integration/generated/bodyDateTime/src/operations/datetime.ts index fd1038b061..6d301b2442 100644 --- a/test/integration/generated/bodyDateTime/src/operations/datetime.ts +++ b/test/integration/generated/bodyDateTime/src/operations/datetime.ts @@ -400,7 +400,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -414,7 +414,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -428,7 +428,7 @@ const getOverflowOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -442,7 +442,7 @@ const getUnderflowOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -484,7 +484,7 @@ const getUtcLowercaseMaxDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -498,7 +498,7 @@ const getUtcUppercaseMaxDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -512,7 +512,7 @@ const getUtcUppercaseMaxDateTime7DigitsOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -540,7 +540,7 @@ const getLocalPositiveOffsetLowercaseMaxDateTimeOperationSpec: coreHttp.Operatio httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -554,7 +554,7 @@ const getLocalPositiveOffsetUppercaseMaxDateTimeOperationSpec: coreHttp.Operatio httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -582,7 +582,7 @@ const getLocalNegativeOffsetUppercaseMaxDateTimeOperationSpec: coreHttp.Operatio httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -596,7 +596,7 @@ const getLocalNegativeOffsetLowercaseMaxDateTimeOperationSpec: coreHttp.Operatio httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -624,7 +624,7 @@ const getUtcMinDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -652,7 +652,7 @@ const getLocalPositiveOffsetMinDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -680,7 +680,7 @@ const getLocalNegativeOffsetMinDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "DateTime" }, serializedName: "DateTime" } + bodyMapper: { type: { name: "DateTime" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/models/mappers.ts b/test/integration/generated/bodyDateTimeRfc1123/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/models/mappers.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/models/parameters.ts b/test/integration/generated/bodyDateTimeRfc1123/src/models/parameters.ts index becf933193..edf7fad502 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/models/parameters.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts index 7af2fc5e69..0be26e15fb 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts @@ -191,10 +191,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -208,10 +205,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -225,10 +219,7 @@ const getOverflowOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -242,10 +233,7 @@ const getUnderflowOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -273,10 +261,7 @@ const getUtcLowercaseMaxDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -290,10 +275,7 @@ const getUtcUppercaseMaxDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -321,10 +303,7 @@ const getUtcMinDateTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } + bodyMapper: { type: { name: "DateTimeRfc1123" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyDictionary/src/models/mappers.ts b/test/integration/generated/bodyDictionary/src/models/mappers.ts index 29faea023c..e3d4ead329 100644 --- a/test/integration/generated/bodyDictionary/src/models/mappers.ts +++ b/test/integration/generated/bodyDictionary/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -21,7 +20,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const Widget: coreHttp.CompositeMapper = { - serializedName: "Widget", type: { name: "Composite", className: "Widget", diff --git a/test/integration/generated/bodyDictionary/src/models/parameters.ts b/test/integration/generated/bodyDictionary/src/models/parameters.ts index a9c6504563..7d5716d0ec 100644 --- a/test/integration/generated/bodyDictionary/src/models/parameters.ts +++ b/test/integration/generated/bodyDictionary/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -40,7 +40,7 @@ export const arrayBody: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } + value: { type: { name: "String" } } } } }; @@ -52,7 +52,7 @@ export const arrayBody1: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Boolean" }, serializedName: "Boolean" } + value: { type: { name: "Boolean" } } } } }; @@ -64,7 +64,7 @@ export const arrayBody2: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } + value: { type: { name: "Number" } } } } }; @@ -76,7 +76,7 @@ export const arrayBody3: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } + value: { type: { name: "Number" } } } } }; @@ -88,7 +88,7 @@ export const arrayBody4: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } + value: { type: { name: "Number" } } } } }; @@ -100,7 +100,7 @@ export const arrayBody5: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } + value: { type: { name: "Number" } } } } }; @@ -112,7 +112,7 @@ export const arrayBody6: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } + value: { type: { name: "String" } } } } }; @@ -124,7 +124,7 @@ export const arrayBody7: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "Date" }, serializedName: "Date" } + value: { type: { name: "Date" } } } } }; @@ -136,7 +136,7 @@ export const arrayBody8: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "DateTime" }, serializedName: "DateTime" } + value: { type: { name: "DateTime" } } } } }; @@ -148,7 +148,7 @@ export const arrayBody9: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "DateTimeRfc1123" }, serializedName: "DateTime" } + value: { type: { name: "DateTimeRfc1123" } } } } }; @@ -160,7 +160,7 @@ export const arrayBody10: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "TimeSpan" }, serializedName: "Duration" } + value: { type: { name: "TimeSpan" } } } } }; @@ -172,7 +172,7 @@ export const arrayBody11: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "ByteArray" }, serializedName: "ByteArray" } + value: { type: { name: "ByteArray" } } } } }; @@ -197,14 +197,7 @@ export const arrayBody13: coreHttp.OperationParameter = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "PutContentSchemaItemsItem" - } - }, - serializedName: "ArrayOfPutContentSchemaItemsItem" + type: { name: "Sequence", element: { type: { name: "String" } } } } } } @@ -217,7 +210,7 @@ export const arrayBody14: coreHttp.OperationParameter = { required: true, type: { name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } + value: { type: { name: "any" } } } } }; diff --git a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts index d2c61424c3..2c0b684acf 100644 --- a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts +++ b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts @@ -1182,11 +1182,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1202,11 +1198,7 @@ const getEmptyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1236,11 +1228,7 @@ const getNullValueOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1256,11 +1244,7 @@ const getNullKeyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1276,11 +1260,7 @@ const getEmptyStringKeyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1296,11 +1276,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1316,11 +1292,7 @@ const getBooleanTfftOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "DictionaryOfBoolean" + type: { name: "Dictionary", value: { type: { name: "Boolean" } } } } }, default: { @@ -1350,11 +1322,7 @@ const getBooleanInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "DictionaryOfBoolean" + type: { name: "Dictionary", value: { type: { name: "Boolean" } } } } }, default: { @@ -1370,11 +1338,7 @@ const getBooleanInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Boolean" }, serializedName: "Boolean" } - }, - serializedName: "DictionaryOfBoolean" + type: { name: "Dictionary", value: { type: { name: "Boolean" } } } } }, default: { @@ -1390,11 +1354,7 @@ const getIntegerValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1424,11 +1384,7 @@ const getIntInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1444,11 +1400,7 @@ const getIntInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1464,11 +1416,7 @@ const getLongValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1498,11 +1446,7 @@ const getLongInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1518,11 +1462,7 @@ const getLongInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1538,11 +1478,7 @@ const getFloatValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1572,11 +1508,7 @@ const getFloatInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1592,11 +1524,7 @@ const getFloatInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1612,11 +1540,7 @@ const getDoubleValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1646,11 +1570,7 @@ const getDoubleInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1666,11 +1586,7 @@ const getDoubleInvalidStringOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Number" } - }, - serializedName: "DictionaryOfNumber" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -1686,11 +1602,7 @@ const getStringValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1720,11 +1632,7 @@ const getStringWithNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1740,11 +1648,7 @@ const getStringWithInvalidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "DictionaryOfString" + type: { name: "Dictionary", value: { type: { name: "String" } } } } }, default: { @@ -1760,11 +1664,7 @@ const getDateValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "DictionaryOfDate" + type: { name: "Dictionary", value: { type: { name: "Date" } } } } }, default: { @@ -1794,11 +1694,7 @@ const getDateInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "DictionaryOfDate" + type: { name: "Dictionary", value: { type: { name: "Date" } } } } }, default: { @@ -1814,11 +1710,7 @@ const getDateInvalidCharsOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Date" }, serializedName: "Date" } - }, - serializedName: "DictionaryOfDate" + type: { name: "Dictionary", value: { type: { name: "Date" } } } } }, default: { @@ -1834,11 +1726,7 @@ const getDateTimeValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "DictionaryOfDateTime" + type: { name: "Dictionary", value: { type: { name: "DateTime" } } } } }, default: { @@ -1868,11 +1756,7 @@ const getDateTimeInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "DictionaryOfDateTime" + type: { name: "Dictionary", value: { type: { name: "DateTime" } } } } }, default: { @@ -1888,11 +1772,7 @@ const getDateTimeInvalidCharsOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "DateTime" }, serializedName: "DateTime" } - }, - serializedName: "DictionaryOfDateTime" + type: { name: "Dictionary", value: { type: { name: "DateTime" } } } } }, default: { @@ -1910,12 +1790,8 @@ const getDateTimeRfc1123ValidOperationSpec: coreHttp.OperationSpec = { bodyMapper: { type: { name: "Dictionary", - value: { - type: { name: "DateTimeRfc1123" }, - serializedName: "DateTime" - } - }, - serializedName: "DictionaryOfDateTime" + value: { type: { name: "DateTimeRfc1123" } } + } } }, default: { @@ -1945,11 +1821,7 @@ const getDurationValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "TimeSpan" }, serializedName: "Duration" } - }, - serializedName: "DictionaryOfDuration" + type: { name: "Dictionary", value: { type: { name: "TimeSpan" } } } } }, default: { @@ -1979,11 +1851,7 @@ const getByteValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "ByteArray" }, serializedName: "ByteArray" } - }, - serializedName: "DictionaryOfByteArray" + type: { name: "Dictionary", value: { type: { name: "ByteArray" } } } } }, default: { @@ -2013,11 +1881,7 @@ const getByteInvalidNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "ByteArray" }, serializedName: "ByteArray" } - }, - serializedName: "DictionaryOfByteArray" + type: { name: "Dictionary", value: { type: { name: "ByteArray" } } } } }, default: { @@ -2033,11 +1897,7 @@ const getBase64UrlOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Base64Url" }, serializedName: "ByteArray" } - }, - serializedName: "DictionaryOfByteArray" + type: { name: "Dictionary", value: { type: { name: "Base64Url" } } } } }, default: { @@ -2056,8 +1916,7 @@ const getComplexNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "Widget" } } - }, - serializedName: "DictionaryOfWidget" + } } }, default: { @@ -2076,8 +1935,7 @@ const getComplexEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "Widget" } } - }, - serializedName: "DictionaryOfWidget" + } } }, default: { @@ -2096,8 +1954,7 @@ const getComplexItemNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "Widget" } } - }, - serializedName: "DictionaryOfWidget" + } } }, default: { @@ -2116,8 +1973,7 @@ const getComplexItemEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "Widget" } } - }, - serializedName: "DictionaryOfWidget" + } } }, default: { @@ -2136,8 +1992,7 @@ const getComplexValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "Widget" } } - }, - serializedName: "DictionaryOfWidget" + } } }, default: { @@ -2170,19 +2025,9 @@ const getArrayNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "Get200ApplicationJsonAdditionalPropertiesItem" - } - }, - serializedName: - "ArrayOfGet200ApplicationJsonAdditionalPropertiesItem" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: - "DictionaryOfpaths1Y9Iid6DictionaryArrayNullGetResponses200ContentApplicationJsonSchemaAdditionalproperties" + } } }, default: { @@ -2201,15 +2046,9 @@ const getArrayEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: - "DictionaryOfpathsAfa1HvDictionaryArrayEmptyGetResponses200ContentApplicationJsonSchemaAdditionalproperties" + } } }, default: { @@ -2228,15 +2067,9 @@ const getArrayItemNullOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: - "DictionaryOfpaths1Xk9Za9DictionaryArrayItemnullGetResponses200ContentApplicationJsonSchemaAdditionalproperties" + } } }, default: { @@ -2255,15 +2088,9 @@ const getArrayItemEmptyOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: - "DictionaryOfpaths3Bo0LmDictionaryArrayItememptyGetResponses200ContentApplicationJsonSchemaAdditionalproperties" + } } }, default: { @@ -2282,15 +2109,9 @@ const getArrayValidOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { - type: { - name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } - }, - serializedName: "ArrayOfString" + type: { name: "Sequence", element: { type: { name: "String" } } } } - }, - serializedName: - "DictionaryOfpathsEx22ApDictionaryArrayValidGetResponses200ContentApplicationJsonSchemaAdditionalproperties" + } } }, default: { @@ -2320,11 +2141,7 @@ const getDictionaryNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } - }, - serializedName: "DictionaryOfany" + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { @@ -2340,11 +2157,7 @@ const getDictionaryEmptyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } - }, - serializedName: "DictionaryOfany" + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { @@ -2360,11 +2173,7 @@ const getDictionaryItemNullOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } - }, - serializedName: "DictionaryOfany" + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { @@ -2380,11 +2189,7 @@ const getDictionaryItemEmptyOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } - }, - serializedName: "DictionaryOfany" + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { @@ -2400,11 +2205,7 @@ const getDictionaryValidOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "any" }, serializedName: "any" } - }, - serializedName: "DictionaryOfany" + type: { name: "Dictionary", value: { type: { name: "any" } } } } }, default: { diff --git a/test/integration/generated/bodyDuration/src/models/mappers.ts b/test/integration/generated/bodyDuration/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyDuration/src/models/mappers.ts +++ b/test/integration/generated/bodyDuration/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyDuration/src/models/parameters.ts b/test/integration/generated/bodyDuration/src/models/parameters.ts index 066cd0d602..600fa6d4ef 100644 --- a/test/integration/generated/bodyDuration/src/models/parameters.ts +++ b/test/integration/generated/bodyDuration/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyDuration/src/operations/duration.ts b/test/integration/generated/bodyDuration/src/operations/duration.ts index 270c070efb..dc74270ce4 100644 --- a/test/integration/generated/bodyDuration/src/operations/duration.ts +++ b/test/integration/generated/bodyDuration/src/operations/duration.ts @@ -105,7 +105,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "TimeSpan" }, serializedName: "Duration" } + bodyMapper: { type: { name: "TimeSpan" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -133,7 +133,7 @@ const getPositiveDurationOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "TimeSpan" }, serializedName: "Duration" } + bodyMapper: { type: { name: "TimeSpan" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -147,7 +147,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "TimeSpan" }, serializedName: "Duration" } + bodyMapper: { type: { name: "TimeSpan" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyInteger/src/models/mappers.ts b/test/integration/generated/bodyInteger/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyInteger/src/models/mappers.ts +++ b/test/integration/generated/bodyInteger/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyInteger/src/models/parameters.ts b/test/integration/generated/bodyInteger/src/models/parameters.ts index 10d5202de1..ae1da368dd 100644 --- a/test/integration/generated/bodyInteger/src/models/parameters.ts +++ b/test/integration/generated/bodyInteger/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyInteger/src/operations/int.ts b/test/integration/generated/bodyInteger/src/operations/int.ts index fb27cadf6b..136106b5f6 100644 --- a/test/integration/generated/bodyInteger/src/operations/int.ts +++ b/test/integration/generated/bodyInteger/src/operations/int.ts @@ -277,7 +277,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -291,7 +291,7 @@ const getInvalidOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -305,7 +305,7 @@ const getOverflowInt32OperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -319,7 +319,7 @@ const getUnderflowInt32OperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -333,7 +333,7 @@ const getOverflowInt64OperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -347,7 +347,7 @@ const getUnderflowInt64OperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Integer" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -417,7 +417,7 @@ const getUnixTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "UnixTime" }, serializedName: "Unixtime" } + bodyMapper: { type: { name: "UnixTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -445,7 +445,7 @@ const getInvalidUnixTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "UnixTime" }, serializedName: "Unixtime" } + bodyMapper: { type: { name: "UnixTime" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -459,7 +459,7 @@ const getNullUnixTimeOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "UnixTime" }, serializedName: "Unixtime" } + bodyMapper: { type: { name: "UnixTime" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts index 320775629a..ce72a95bfd 100644 --- a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts +++ b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts @@ -18,10 +18,10 @@ class BodyNumberClient extends BodyNumberClientContext { */ constructor(options?: Models.BodyNumberClientOptionalParams) { super(options); - this.number = new operations.Number(this); + this.number = new operations.NumberOperations(this); } - number: operations.Number; + number: operations.NumberOperations; } // Operation Specifications diff --git a/test/integration/generated/bodyNumber/src/models/mappers.ts b/test/integration/generated/bodyNumber/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyNumber/src/models/mappers.ts +++ b/test/integration/generated/bodyNumber/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyNumber/src/models/parameters.ts b/test/integration/generated/bodyNumber/src/models/parameters.ts index 3899142a2a..fccbd941a1 100644 --- a/test/integration/generated/bodyNumber/src/models/parameters.ts +++ b/test/integration/generated/bodyNumber/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -59,8 +59,8 @@ export const numberBody2: coreHttp.OperationParameter = { parameterPath: "numberBody", mapper: { defaultValue: 99999999.99, - serializedName: "numberBody", isConstant: true, + serializedName: "numberBody", type: { name: "Number" } @@ -71,8 +71,8 @@ export const numberBody3: coreHttp.OperationParameter = { parameterPath: "numberBody", mapper: { defaultValue: -99999999.99, - serializedName: "numberBody", isConstant: true, + serializedName: "numberBody", type: { name: "Number" } @@ -94,8 +94,8 @@ export const numberBody5: coreHttp.OperationParameter = { parameterPath: "numberBody", mapper: { defaultValue: 99999999.99, - serializedName: "numberBody", isConstant: true, + serializedName: "numberBody", type: { name: "Number" } @@ -106,8 +106,8 @@ export const numberBody6: coreHttp.OperationParameter = { parameterPath: "numberBody", mapper: { defaultValue: -99999999.99, - serializedName: "numberBody", isConstant: true, + serializedName: "numberBody", type: { name: "Number" } diff --git a/test/integration/generated/bodyNumber/src/operations/number.ts b/test/integration/generated/bodyNumber/src/operations/number.ts index 7a7a12f31f..6569afe630 100644 --- a/test/integration/generated/bodyNumber/src/operations/number.ts +++ b/test/integration/generated/bodyNumber/src/operations/number.ts @@ -28,13 +28,13 @@ import { } from "../models"; /** - * Class representing a Number. + * Class representing a NumberOperations. */ -export class Number { +export class NumberOperations { private readonly client: BodyNumberClient; /** - * Initialize a new instance of the class Number class. + * Initialize a new instance of the class NumberOperations class. * @param client Reference to the service client */ constructor(client: BodyNumberClient) { @@ -444,7 +444,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -458,7 +458,7 @@ const getInvalidFloatOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -472,7 +472,7 @@ const getInvalidDoubleOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -486,7 +486,7 @@ const getInvalidDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -514,7 +514,7 @@ const getBigFloatOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -542,7 +542,7 @@ const getBigDoubleOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -570,7 +570,7 @@ const getBigDoublePositiveDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -598,7 +598,7 @@ const getBigDoubleNegativeDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -626,7 +626,7 @@ const getBigDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -654,7 +654,7 @@ const getBigDecimalPositiveDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -682,7 +682,7 @@ const getBigDecimalNegativeDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -710,7 +710,7 @@ const getSmallFloatOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -738,7 +738,7 @@ const getSmallDoubleOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -766,7 +766,7 @@ const getSmallDecimalOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Number" }, serializedName: "Number" } + bodyMapper: { type: { name: "Number" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyString/src/bodyStringClient.ts b/test/integration/generated/bodyString/src/bodyStringClient.ts index f54e7c1afd..0689fc3e18 100644 --- a/test/integration/generated/bodyString/src/bodyStringClient.ts +++ b/test/integration/generated/bodyString/src/bodyStringClient.ts @@ -18,11 +18,11 @@ class BodyStringClient extends BodyStringClientContext { */ constructor(options?: Models.BodyStringClientOptionalParams) { super(options); - this.string = new operations.String(this); + this.string = new operations.StringOperations(this); this.enum = new operations.Enum(this); } - string: operations.String; + string: operations.StringOperations; enum: operations.Enum; } diff --git a/test/integration/generated/bodyString/src/models/mappers.ts b/test/integration/generated/bodyString/src/models/mappers.ts index b0f91b00ce..25d8cc3630 100644 --- a/test/integration/generated/bodyString/src/models/mappers.ts +++ b/test/integration/generated/bodyString/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -21,16 +20,15 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const RefColorConstant: coreHttp.CompositeMapper = { - serializedName: "RefColorConstant", type: { name: "Composite", className: "RefColorConstant", modelProperties: { colorConstant: { type: { name: "String" }, - serializedName: "ColorConstant", defaultValue: "green-color", - isConstant: true + isConstant: true, + serializedName: "ColorConstant" }, field1: { type: { name: "String" }, serializedName: "field1" } } diff --git a/test/integration/generated/bodyString/src/models/parameters.ts b/test/integration/generated/bodyString/src/models/parameters.ts index 9b7256f881..552cb43b93 100644 --- a/test/integration/generated/bodyString/src/models/parameters.ts +++ b/test/integration/generated/bodyString/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -47,8 +47,8 @@ export const stringBody1: coreHttp.OperationParameter = { parameterPath: "stringBody", mapper: { defaultValue: "", - serializedName: "stringBody", isConstant: true, + serializedName: "stringBody", type: { name: "String" } @@ -60,8 +60,8 @@ export const stringBody2: coreHttp.OperationParameter = { mapper: { defaultValue: "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€", - serializedName: "stringBody", isConstant: true, + serializedName: "stringBody", type: { name: "String" } @@ -73,8 +73,8 @@ export const stringBody3: coreHttp.OperationParameter = { mapper: { defaultValue: " Now is the time for all good men to come to the aid of their country ", - serializedName: "stringBody", isConstant: true, + serializedName: "stringBody", type: { name: "String" } diff --git a/test/integration/generated/bodyString/src/operations/enum.ts b/test/integration/generated/bodyString/src/operations/enum.ts index c8c32c6093..b1bc864b17 100644 --- a/test/integration/generated/bodyString/src/operations/enum.ts +++ b/test/integration/generated/bodyString/src/operations/enum.ts @@ -147,8 +147,7 @@ const getNotExpandableOperationSpec: coreHttp.OperationSpec = { type: { name: "Enum", allowedValues: ["red color", "green-color", "blue_color"] - }, - serializedName: "Colors" + } } }, default: { @@ -181,8 +180,7 @@ const getReferencedOperationSpec: coreHttp.OperationSpec = { type: { name: "Enum", allowedValues: ["red color", "green-color", "blue_color"] - }, - serializedName: "Colors" + } } }, default: { diff --git a/test/integration/generated/bodyString/src/operations/string.ts b/test/integration/generated/bodyString/src/operations/string.ts index aaf151d3ec..934cf0b06c 100644 --- a/test/integration/generated/bodyString/src/operations/string.ts +++ b/test/integration/generated/bodyString/src/operations/string.ts @@ -23,13 +23,13 @@ import { } from "../models"; /** - * Class representing a String. + * Class representing a StringOperations. */ -export class String { +export class StringOperations { private readonly client: BodyStringClient; /** - * Initialize a new instance of the class String class. + * Initialize a new instance of the class StringOperations class. * @param client Reference to the service client */ constructor(client: BodyStringClient) { @@ -251,7 +251,7 @@ const getNullOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -279,7 +279,7 @@ const getEmptyOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -307,7 +307,7 @@ const getMbcsOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -335,7 +335,7 @@ const getWhitespaceOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -363,7 +363,7 @@ const getNotProvidedOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -377,7 +377,7 @@ const getBase64EncodedOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Base64Url" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "Base64Url" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -391,7 +391,7 @@ const getBase64UrlEncodedOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Base64Url" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "Base64Url" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -419,7 +419,7 @@ const getNullBase64UrlEncodedOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "Base64Url" }, serializedName: "ByteArray" } + bodyMapper: { type: { name: "Base64Url" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/bodyTime/src/models/mappers.ts b/test/integration/generated/bodyTime/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/bodyTime/src/models/mappers.ts +++ b/test/integration/generated/bodyTime/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/bodyTime/src/models/parameters.ts b/test/integration/generated/bodyTime/src/models/parameters.ts index c8352f4314..6f6b6764b0 100644 --- a/test/integration/generated/bodyTime/src/models/parameters.ts +++ b/test/integration/generated/bodyTime/src/models/parameters.ts @@ -25,8 +25,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/bodyTime/src/operations/time.ts b/test/integration/generated/bodyTime/src/operations/time.ts index 9cd4ebe527..33a738a76d 100644 --- a/test/integration/generated/bodyTime/src/operations/time.ts +++ b/test/integration/generated/bodyTime/src/operations/time.ts @@ -69,7 +69,7 @@ const getOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "time" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel @@ -83,7 +83,7 @@ const putOperationSpec: coreHttp.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } }, default: { bodyMapper: Mappers.ErrorModel diff --git a/test/integration/generated/customUrl/src/models/mappers.ts b/test/integration/generated/customUrl/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/customUrl/src/models/mappers.ts +++ b/test/integration/generated/customUrl/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/header/src/models/index.ts b/test/integration/generated/header/src/models/index.ts index 0a5a0b28e9..b12d4c968e 100644 --- a/test/integration/generated/header/src/models/index.ts +++ b/test/integration/generated/header/src/models/index.ts @@ -14,98 +14,98 @@ export interface ErrorModel { } /** - * Defines headers for header_responseExistingKey operation. + * Defines headers for Header_responseExistingKey operation. */ export interface HeaderResponseExistingKeyHeaders { userAgent?: string; } /** - * Defines headers for header_responseProtectedKey operation. + * Defines headers for Header_responseProtectedKey operation. */ export interface HeaderResponseProtectedKeyHeaders { contentType?: string; } /** - * Defines headers for header_responseInteger operation. + * Defines headers for Header_responseInteger operation. */ export interface HeaderResponseIntegerHeaders { value?: number; } /** - * Defines headers for header_responseLong operation. + * Defines headers for Header_responseLong operation. */ export interface HeaderResponseLongHeaders { value?: number; } /** - * Defines headers for header_responseFloat operation. + * Defines headers for Header_responseFloat operation. */ export interface HeaderResponseFloatHeaders { value?: number; } /** - * Defines headers for header_responseDouble operation. + * Defines headers for Header_responseDouble operation. */ export interface HeaderResponseDoubleHeaders { value?: number; } /** - * Defines headers for header_responseBool operation. + * Defines headers for Header_responseBool operation. */ export interface HeaderResponseBoolHeaders { value?: boolean; } /** - * Defines headers for header_responseString operation. + * Defines headers for Header_responseString operation. */ export interface HeaderResponseStringHeaders { value?: string; } /** - * Defines headers for header_responseDate operation. + * Defines headers for Header_responseDate operation. */ export interface HeaderResponseDateHeaders { value?: Date; } /** - * Defines headers for header_responseDatetime operation. + * Defines headers for Header_responseDatetime operation. */ export interface HeaderResponseDatetimeHeaders { value?: Date; } /** - * Defines headers for header_responseDatetimeRfc1123 operation. + * Defines headers for Header_responseDatetimeRfc1123 operation. */ export interface HeaderResponseDatetimeRfc1123Headers { value?: Date; } /** - * Defines headers for header_responseDuration operation. + * Defines headers for Header_responseDuration operation. */ export interface HeaderResponseDurationHeaders { value?: string; } /** - * Defines headers for header_responseByte operation. + * Defines headers for Header_responseByte operation. */ export interface HeaderResponseByteHeaders { value?: Uint8Array; } /** - * Defines headers for header_responseEnum operation. + * Defines headers for Header_responseEnum operation. */ export interface HeaderResponseEnumHeaders { value?: GreyscaleColors; diff --git a/test/integration/generated/header/src/models/mappers.ts b/test/integration/generated/header/src/models/mappers.ts index 3a5e515932..1c7742f225 100644 --- a/test/integration/generated/header/src/models/mappers.ts +++ b/test/integration/generated/header/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -21,7 +20,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const HeaderResponseExistingKeyHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseExistingKeyHeaders", type: { name: "Composite", className: "HeaderResponseExistingKeyHeaders", @@ -32,7 +30,6 @@ export const HeaderResponseExistingKeyHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseProtectedKeyHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseProtectedKeyHeaders", type: { name: "Composite", className: "HeaderResponseProtectedKeyHeaders", @@ -43,7 +40,6 @@ export const HeaderResponseProtectedKeyHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseIntegerHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseIntegerHeaders", type: { name: "Composite", className: "HeaderResponseIntegerHeaders", @@ -54,7 +50,6 @@ export const HeaderResponseIntegerHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseLongHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseLongHeaders", type: { name: "Composite", className: "HeaderResponseLongHeaders", @@ -65,7 +60,6 @@ export const HeaderResponseLongHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseFloatHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseFloatHeaders", type: { name: "Composite", className: "HeaderResponseFloatHeaders", @@ -76,7 +70,6 @@ export const HeaderResponseFloatHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseDoubleHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseDoubleHeaders", type: { name: "Composite", className: "HeaderResponseDoubleHeaders", @@ -87,7 +80,6 @@ export const HeaderResponseDoubleHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseBoolHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseBoolHeaders", type: { name: "Composite", className: "HeaderResponseBoolHeaders", @@ -98,7 +90,6 @@ export const HeaderResponseBoolHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseStringHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseStringHeaders", type: { name: "Composite", className: "HeaderResponseStringHeaders", @@ -109,7 +100,6 @@ export const HeaderResponseStringHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseDateHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseDateHeaders", type: { name: "Composite", className: "HeaderResponseDateHeaders", @@ -120,7 +110,6 @@ export const HeaderResponseDateHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseDatetimeHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseDatetimeHeaders", type: { name: "Composite", className: "HeaderResponseDatetimeHeaders", @@ -131,7 +120,6 @@ export const HeaderResponseDatetimeHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseDatetimeRfc1123Headers: coreHttp.CompositeMapper = { - serializedName: "header_responseDatetimeRfc1123Headers", type: { name: "Composite", className: "HeaderResponseDatetimeRfc1123Headers", @@ -142,7 +130,6 @@ export const HeaderResponseDatetimeRfc1123Headers: coreHttp.CompositeMapper = { }; export const HeaderResponseDurationHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseDurationHeaders", type: { name: "Composite", className: "HeaderResponseDurationHeaders", @@ -153,7 +140,6 @@ export const HeaderResponseDurationHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseByteHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseByteHeaders", type: { name: "Composite", className: "HeaderResponseByteHeaders", @@ -164,7 +150,6 @@ export const HeaderResponseByteHeaders: coreHttp.CompositeMapper = { }; export const HeaderResponseEnumHeaders: coreHttp.CompositeMapper = { - serializedName: "header_responseEnumHeaders", type: { name: "Composite", className: "HeaderResponseEnumHeaders", diff --git a/test/integration/generated/lro/src/models/index.ts b/test/integration/generated/lro/src/models/index.ts index 5adde92203..0a2cfb0c5b 100644 --- a/test/integration/generated/lro/src/models/index.ts +++ b/test/integration/generated/lro/src/models/index.ts @@ -78,14 +78,14 @@ export interface OperationResultError { } /** - * Defines headers for lROs_putNoHeaderInRetry operation. + * Defines headers for LROs_putNoHeaderInRetry operation. */ export interface LROsPutNoHeaderInRetryHeaders { location?: string; } /** - * Defines headers for lROs_putAsyncRetrySucceeded operation. + * Defines headers for LROs_putAsyncRetrySucceeded operation. */ export interface LROsPutAsyncRetrySucceededHeaders { azureAsyncOperation?: string; @@ -94,7 +94,7 @@ export interface LROsPutAsyncRetrySucceededHeaders { } /** - * Defines headers for lROs_putAsyncNoRetrySucceeded operation. + * Defines headers for LROs_putAsyncNoRetrySucceeded operation. */ export interface LROsPutAsyncNoRetrySucceededHeaders { azureAsyncOperation?: string; @@ -102,7 +102,7 @@ export interface LROsPutAsyncNoRetrySucceededHeaders { } /** - * Defines headers for lROs_putAsyncRetryFailed operation. + * Defines headers for LROs_putAsyncRetryFailed operation. */ export interface LROsPutAsyncRetryFailedHeaders { azureAsyncOperation?: string; @@ -111,7 +111,7 @@ export interface LROsPutAsyncRetryFailedHeaders { } /** - * Defines headers for lROs_putAsyncNoRetrycanceled operation. + * Defines headers for LROs_putAsyncNoRetrycanceled operation. */ export interface LROsPutAsyncNoRetrycanceledHeaders { azureAsyncOperation?: string; @@ -119,14 +119,14 @@ export interface LROsPutAsyncNoRetrycanceledHeaders { } /** - * Defines headers for lROs_putAsyncNoHeaderInRetry operation. + * Defines headers for LROs_putAsyncNoHeaderInRetry operation. */ export interface LROsPutAsyncNoHeaderInRetryHeaders { azureAsyncOperation?: string; } /** - * Defines headers for lROs_deleteProvisioning202Accepted200Succeeded operation. + * Defines headers for LROs_deleteProvisioning202Accepted200Succeeded operation. */ export interface LROsDeleteProvisioning202Accepted200SucceededHeaders { location?: string; @@ -134,7 +134,7 @@ export interface LROsDeleteProvisioning202Accepted200SucceededHeaders { } /** - * Defines headers for lROs_deleteProvisioning202DeletingFailed200 operation. + * Defines headers for LROs_deleteProvisioning202DeletingFailed200 operation. */ export interface LROsDeleteProvisioning202DeletingFailed200Headers { location?: string; @@ -142,7 +142,7 @@ export interface LROsDeleteProvisioning202DeletingFailed200Headers { } /** - * Defines headers for lROs_deleteProvisioning202Deletingcanceled200 operation. + * Defines headers for LROs_deleteProvisioning202Deletingcanceled200 operation. */ export interface LROsDeleteProvisioning202Deletingcanceled200Headers { location?: string; @@ -150,7 +150,7 @@ export interface LROsDeleteProvisioning202Deletingcanceled200Headers { } /** - * Defines headers for lROs_delete202Retry200 operation. + * Defines headers for LROs_delete202Retry200 operation. */ export interface LROsDelete202Retry200Headers { location?: string; @@ -158,7 +158,7 @@ export interface LROsDelete202Retry200Headers { } /** - * Defines headers for lROs_delete202NoRetry204 operation. + * Defines headers for LROs_delete202NoRetry204 operation. */ export interface LROsDelete202NoRetry204Headers { location?: string; @@ -166,21 +166,21 @@ export interface LROsDelete202NoRetry204Headers { } /** - * Defines headers for lROs_deleteNoHeaderInRetry operation. + * Defines headers for LROs_deleteNoHeaderInRetry operation. */ export interface LROsDeleteNoHeaderInRetryHeaders { location?: string; } /** - * Defines headers for lROs_deleteAsyncNoHeaderInRetry operation. + * Defines headers for LROs_deleteAsyncNoHeaderInRetry operation. */ export interface LROsDeleteAsyncNoHeaderInRetryHeaders { location?: string; } /** - * Defines headers for lROs_deleteAsyncRetrySucceeded operation. + * Defines headers for LROs_deleteAsyncRetrySucceeded operation. */ export interface LROsDeleteAsyncRetrySucceededHeaders { azureAsyncOperation?: string; @@ -189,7 +189,7 @@ export interface LROsDeleteAsyncRetrySucceededHeaders { } /** - * Defines headers for lROs_deleteAsyncNoRetrySucceeded operation. + * Defines headers for LROs_deleteAsyncNoRetrySucceeded operation. */ export interface LROsDeleteAsyncNoRetrySucceededHeaders { azureAsyncOperation?: string; @@ -198,7 +198,7 @@ export interface LROsDeleteAsyncNoRetrySucceededHeaders { } /** - * Defines headers for lROs_deleteAsyncRetryFailed operation. + * Defines headers for LROs_deleteAsyncRetryFailed operation. */ export interface LROsDeleteAsyncRetryFailedHeaders { azureAsyncOperation?: string; @@ -207,7 +207,7 @@ export interface LROsDeleteAsyncRetryFailedHeaders { } /** - * Defines headers for lROs_deleteAsyncRetrycanceled operation. + * Defines headers for LROs_deleteAsyncRetrycanceled operation. */ export interface LROsDeleteAsyncRetrycanceledHeaders { azureAsyncOperation?: string; @@ -216,7 +216,7 @@ export interface LROsDeleteAsyncRetrycanceledHeaders { } /** - * Defines headers for lROs_post202Retry200 operation. + * Defines headers for LROs_post202Retry200 operation. */ export interface LROsPost202Retry200Headers { location?: string; @@ -224,7 +224,7 @@ export interface LROsPost202Retry200Headers { } /** - * Defines headers for lROs_post202NoRetry204 operation. + * Defines headers for LROs_post202NoRetry204 operation. */ export interface LROsPost202NoRetry204Headers { location?: string; @@ -232,7 +232,7 @@ export interface LROsPost202NoRetry204Headers { } /** - * Defines headers for lROs_postAsyncRetrySucceeded operation. + * Defines headers for LROs_postAsyncRetrySucceeded operation. */ export interface LROsPostAsyncRetrySucceededHeaders { azureAsyncOperation?: string; @@ -241,7 +241,7 @@ export interface LROsPostAsyncRetrySucceededHeaders { } /** - * Defines headers for lROs_postAsyncNoRetrySucceeded operation. + * Defines headers for LROs_postAsyncNoRetrySucceeded operation. */ export interface LROsPostAsyncNoRetrySucceededHeaders { azureAsyncOperation?: string; @@ -250,7 +250,7 @@ export interface LROsPostAsyncNoRetrySucceededHeaders { } /** - * Defines headers for lROs_postAsyncRetryFailed operation. + * Defines headers for LROs_postAsyncRetryFailed operation. */ export interface LROsPostAsyncRetryFailedHeaders { azureAsyncOperation?: string; @@ -259,7 +259,7 @@ export interface LROsPostAsyncRetryFailedHeaders { } /** - * Defines headers for lROs_postAsyncRetrycanceled operation. + * Defines headers for LROs_postAsyncRetrycanceled operation. */ export interface LROsPostAsyncRetrycanceledHeaders { azureAsyncOperation?: string; @@ -268,7 +268,7 @@ export interface LROsPostAsyncRetrycanceledHeaders { } /** - * Defines headers for lRORetrys_putAsyncRelativeRetrySucceeded operation. + * Defines headers for LRORetrys_putAsyncRelativeRetrySucceeded operation. */ export interface LRORetrysPutAsyncRelativeRetrySucceededHeaders { azureAsyncOperation?: string; @@ -277,7 +277,7 @@ export interface LRORetrysPutAsyncRelativeRetrySucceededHeaders { } /** - * Defines headers for lRORetrys_deleteProvisioning202Accepted200Succeeded operation. + * Defines headers for LRORetrys_deleteProvisioning202Accepted200Succeeded operation. */ export interface LRORetrysDeleteProvisioning202Accepted200SucceededHeaders { location?: string; @@ -285,7 +285,7 @@ export interface LRORetrysDeleteProvisioning202Accepted200SucceededHeaders { } /** - * Defines headers for lRORetrys_delete202Retry200 operation. + * Defines headers for LRORetrys_delete202Retry200 operation. */ export interface LRORetrysDelete202Retry200Headers { location?: string; @@ -293,7 +293,7 @@ export interface LRORetrysDelete202Retry200Headers { } /** - * Defines headers for lRORetrys_deleteAsyncRelativeRetrySucceeded operation. + * Defines headers for LRORetrys_deleteAsyncRelativeRetrySucceeded operation. */ export interface LRORetrysDeleteAsyncRelativeRetrySucceededHeaders { azureAsyncOperation?: string; @@ -302,7 +302,7 @@ export interface LRORetrysDeleteAsyncRelativeRetrySucceededHeaders { } /** - * Defines headers for lRORetrys_post202Retry200 operation. + * Defines headers for LRORetrys_post202Retry200 operation. */ export interface LRORetrysPost202Retry200Headers { location?: string; @@ -310,7 +310,7 @@ export interface LRORetrysPost202Retry200Headers { } /** - * Defines headers for lRORetrys_postAsyncRelativeRetrySucceeded operation. + * Defines headers for LRORetrys_postAsyncRelativeRetrySucceeded operation. */ export interface LRORetrysPostAsyncRelativeRetrySucceededHeaders { azureAsyncOperation?: string; @@ -319,7 +319,7 @@ export interface LRORetrysPostAsyncRelativeRetrySucceededHeaders { } /** - * Defines headers for lrosaDs_putAsyncRelativeRetry400 operation. + * Defines headers for LrosaDs_putAsyncRelativeRetry400 operation. */ export interface LrosaDsPutAsyncRelativeRetry400Headers { azureAsyncOperation?: string; @@ -328,7 +328,7 @@ export interface LrosaDsPutAsyncRelativeRetry400Headers { } /** - * Defines headers for lrosaDs_deleteNonRetry400 operation. + * Defines headers for LrosaDs_deleteNonRetry400 operation. */ export interface LrosaDsDeleteNonRetry400Headers { location?: string; @@ -336,7 +336,7 @@ export interface LrosaDsDeleteNonRetry400Headers { } /** - * Defines headers for lrosaDs_delete202NonRetry400 operation. + * Defines headers for LrosaDs_delete202NonRetry400 operation. */ export interface LrosaDsDelete202NonRetry400Headers { location?: string; @@ -344,7 +344,7 @@ export interface LrosaDsDelete202NonRetry400Headers { } /** - * Defines headers for lrosaDs_deleteAsyncRelativeRetry400 operation. + * Defines headers for LrosaDs_deleteAsyncRelativeRetry400 operation. */ export interface LrosaDsDeleteAsyncRelativeRetry400Headers { azureAsyncOperation?: string; @@ -353,7 +353,7 @@ export interface LrosaDsDeleteAsyncRelativeRetry400Headers { } /** - * Defines headers for lrosaDs_postNonRetry400 operation. + * Defines headers for LrosaDs_postNonRetry400 operation. */ export interface LrosaDsPostNonRetry400Headers { location?: string; @@ -361,7 +361,7 @@ export interface LrosaDsPostNonRetry400Headers { } /** - * Defines headers for lrosaDs_post202NonRetry400 operation. + * Defines headers for LrosaDs_post202NonRetry400 operation. */ export interface LrosaDsPost202NonRetry400Headers { location?: string; @@ -369,7 +369,7 @@ export interface LrosaDsPost202NonRetry400Headers { } /** - * Defines headers for lrosaDs_postAsyncRelativeRetry400 operation. + * Defines headers for LrosaDs_postAsyncRelativeRetry400 operation. */ export interface LrosaDsPostAsyncRelativeRetry400Headers { azureAsyncOperation?: string; @@ -378,7 +378,7 @@ export interface LrosaDsPostAsyncRelativeRetry400Headers { } /** - * Defines headers for lrosaDs_putAsyncRelativeRetryNoStatus operation. + * Defines headers for LrosaDs_putAsyncRelativeRetryNoStatus operation. */ export interface LrosaDsPutAsyncRelativeRetryNoStatusHeaders { azureAsyncOperation?: string; @@ -387,7 +387,7 @@ export interface LrosaDsPutAsyncRelativeRetryNoStatusHeaders { } /** - * Defines headers for lrosaDs_putAsyncRelativeRetryNoStatusPayload operation. + * Defines headers for LrosaDs_putAsyncRelativeRetryNoStatusPayload operation. */ export interface LrosaDsPutAsyncRelativeRetryNoStatusPayloadHeaders { azureAsyncOperation?: string; @@ -396,7 +396,7 @@ export interface LrosaDsPutAsyncRelativeRetryNoStatusPayloadHeaders { } /** - * Defines headers for lrosaDs_deleteAsyncRelativeRetryNoStatus operation. + * Defines headers for LrosaDs_deleteAsyncRelativeRetryNoStatus operation. */ export interface LrosaDsDeleteAsyncRelativeRetryNoStatusHeaders { azureAsyncOperation?: string; @@ -405,7 +405,7 @@ export interface LrosaDsDeleteAsyncRelativeRetryNoStatusHeaders { } /** - * Defines headers for lrosaDs_post202NoLocation operation. + * Defines headers for LrosaDs_post202NoLocation operation. */ export interface LrosaDsPost202NoLocationHeaders { location?: string; @@ -413,7 +413,7 @@ export interface LrosaDsPost202NoLocationHeaders { } /** - * Defines headers for lrosaDs_postAsyncRelativeRetryNoPayload operation. + * Defines headers for LrosaDs_postAsyncRelativeRetryNoPayload operation. */ export interface LrosaDsPostAsyncRelativeRetryNoPayloadHeaders { azureAsyncOperation?: string; @@ -422,7 +422,7 @@ export interface LrosaDsPostAsyncRelativeRetryNoPayloadHeaders { } /** - * Defines headers for lrosaDs_putAsyncRelativeRetryInvalidHeader operation. + * Defines headers for LrosaDs_putAsyncRelativeRetryInvalidHeader operation. */ export interface LrosaDsPutAsyncRelativeRetryInvalidHeaderHeaders { azureAsyncOperation?: string; @@ -431,7 +431,7 @@ export interface LrosaDsPutAsyncRelativeRetryInvalidHeaderHeaders { } /** - * Defines headers for lrosaDs_putAsyncRelativeRetryInvalidJsonPolling operation. + * Defines headers for LrosaDs_putAsyncRelativeRetryInvalidJsonPolling operation. */ export interface LrosaDsPutAsyncRelativeRetryInvalidJsonPollingHeaders { azureAsyncOperation?: string; @@ -440,7 +440,7 @@ export interface LrosaDsPutAsyncRelativeRetryInvalidJsonPollingHeaders { } /** - * Defines headers for lrosaDs_delete202RetryInvalidHeader operation. + * Defines headers for LrosaDs_delete202RetryInvalidHeader operation. */ export interface LrosaDsDelete202RetryInvalidHeaderHeaders { location?: string; @@ -448,7 +448,7 @@ export interface LrosaDsDelete202RetryInvalidHeaderHeaders { } /** - * Defines headers for lrosaDs_deleteAsyncRelativeRetryInvalidHeader operation. + * Defines headers for LrosaDs_deleteAsyncRelativeRetryInvalidHeader operation. */ export interface LrosaDsDeleteAsyncRelativeRetryInvalidHeaderHeaders { azureAsyncOperation?: string; @@ -457,7 +457,7 @@ export interface LrosaDsDeleteAsyncRelativeRetryInvalidHeaderHeaders { } /** - * Defines headers for lrosaDs_deleteAsyncRelativeRetryInvalidJsonPolling operation. + * Defines headers for LrosaDs_deleteAsyncRelativeRetryInvalidJsonPolling operation. */ export interface LrosaDsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders { azureAsyncOperation?: string; @@ -466,7 +466,7 @@ export interface LrosaDsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders { } /** - * Defines headers for lrosaDs_post202RetryInvalidHeader operation. + * Defines headers for LrosaDs_post202RetryInvalidHeader operation. */ export interface LrosaDsPost202RetryInvalidHeaderHeaders { location?: string; @@ -474,7 +474,7 @@ export interface LrosaDsPost202RetryInvalidHeaderHeaders { } /** - * Defines headers for lrosaDs_postAsyncRelativeRetryInvalidHeader operation. + * Defines headers for LrosaDs_postAsyncRelativeRetryInvalidHeader operation. */ export interface LrosaDsPostAsyncRelativeRetryInvalidHeaderHeaders { azureAsyncOperation?: string; @@ -483,7 +483,7 @@ export interface LrosaDsPostAsyncRelativeRetryInvalidHeaderHeaders { } /** - * Defines headers for lrosaDs_postAsyncRelativeRetryInvalidJsonPolling operation. + * Defines headers for LrosaDs_postAsyncRelativeRetryInvalidJsonPolling operation. */ export interface LrosaDsPostAsyncRelativeRetryInvalidJsonPollingHeaders { azureAsyncOperation?: string; @@ -492,7 +492,7 @@ export interface LrosaDsPostAsyncRelativeRetryInvalidJsonPollingHeaders { } /** - * Defines headers for lROsCustomHeader_putAsyncRetrySucceeded operation. + * Defines headers for LROsCustomHeader_putAsyncRetrySucceeded operation. */ export interface LROsCustomHeaderPutAsyncRetrySucceededHeaders { azureAsyncOperation?: string; @@ -501,7 +501,7 @@ export interface LROsCustomHeaderPutAsyncRetrySucceededHeaders { } /** - * Defines headers for lROsCustomHeader_post202Retry200 operation. + * Defines headers for LROsCustomHeader_post202Retry200 operation. */ export interface LROsCustomHeaderPost202Retry200Headers { location?: string; @@ -509,7 +509,7 @@ export interface LROsCustomHeaderPost202Retry200Headers { } /** - * Defines headers for lROsCustomHeader_postAsyncRetrySucceeded operation. + * Defines headers for LROsCustomHeader_postAsyncRetrySucceeded operation. */ export interface LROsCustomHeaderPostAsyncRetrySucceededHeaders { azureAsyncOperation?: string; diff --git a/test/integration/generated/lro/src/models/mappers.ts b/test/integration/generated/lro/src/models/mappers.ts index cc0e01cba5..10fe9415ec 100644 --- a/test/integration/generated/lro/src/models/mappers.ts +++ b/test/integration/generated/lro/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const Resource: coreHttp.CompositeMapper = { - serializedName: "Resource", type: { name: "Composite", className: "Resource", @@ -21,10 +20,7 @@ export const Resource: coreHttp.CompositeMapper = { readOnly: true }, tags: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, + type: { name: "Dictionary", value: { type: { name: "String" } } }, serializedName: "tags" }, location: { type: { name: "String" }, serializedName: "location" }, @@ -34,7 +30,6 @@ export const Resource: coreHttp.CompositeMapper = { }; export const Product: coreHttp.CompositeMapper = { - serializedName: "Product", type: { name: "Composite", className: "Product", @@ -54,7 +49,6 @@ export const Product: coreHttp.CompositeMapper = { }; export const CloudError: coreHttp.CompositeMapper = { - serializedName: "CloudError", type: { name: "Composite", className: "CloudError", @@ -66,7 +60,6 @@ export const CloudError: coreHttp.CompositeMapper = { }; export const Sku: coreHttp.CompositeMapper = { - serializedName: "Sku", type: { name: "Composite", className: "Sku", @@ -78,7 +71,6 @@ export const Sku: coreHttp.CompositeMapper = { }; export const SubResource: coreHttp.CompositeMapper = { - serializedName: "SubResource", type: { name: "Composite", className: "SubResource", @@ -89,7 +81,6 @@ export const SubResource: coreHttp.CompositeMapper = { }; export const SubProduct: coreHttp.CompositeMapper = { - serializedName: "SubProduct", type: { name: "Composite", className: "SubProduct", @@ -109,7 +100,6 @@ export const SubProduct: coreHttp.CompositeMapper = { }; export const OperationResult: coreHttp.CompositeMapper = { - serializedName: "OperationResult", type: { name: "Composite", className: "OperationResult", @@ -124,7 +114,6 @@ export const OperationResult: coreHttp.CompositeMapper = { }; export const OperationResultError: coreHttp.CompositeMapper = { - serializedName: "OperationResultError", type: { name: "Composite", className: "OperationResultError", @@ -136,7 +125,6 @@ export const OperationResultError: coreHttp.CompositeMapper = { }; export const LROsPutNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putNoHeaderInRetryHeaders", type: { name: "Composite", className: "LROsPutNoHeaderInRetryHeaders", @@ -147,7 +135,6 @@ export const LROsPutNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { }; export const LROsPutAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putAsyncRetrySucceededHeaders", type: { name: "Composite", className: "LROsPutAsyncRetrySucceededHeaders", @@ -163,7 +150,6 @@ export const LROsPutAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { }; export const LROsPutAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putAsyncNoRetrySucceededHeaders", type: { name: "Composite", className: "LROsPutAsyncNoRetrySucceededHeaders", @@ -178,7 +164,6 @@ export const LROsPutAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = { }; export const LROsPutAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putAsyncRetryFailedHeaders", type: { name: "Composite", className: "LROsPutAsyncRetryFailedHeaders", @@ -194,7 +179,6 @@ export const LROsPutAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { }; export const LROsPutAsyncNoRetrycanceledHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putAsyncNoRetrycanceledHeaders", type: { name: "Composite", className: "LROsPutAsyncNoRetrycanceledHeaders", @@ -209,7 +193,6 @@ export const LROsPutAsyncNoRetrycanceledHeaders: coreHttp.CompositeMapper = { }; export const LROsPutAsyncNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_putAsyncNoHeaderInRetryHeaders", type: { name: "Composite", className: "LROsPutAsyncNoHeaderInRetryHeaders", @@ -223,7 +206,6 @@ export const LROsPutAsyncNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { }; export const LROsDeleteProvisioning202Accepted200SucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteProvisioning202Accepted200SucceededHeaders", type: { name: "Composite", className: "LROsDeleteProvisioning202Accepted200SucceededHeaders", @@ -235,7 +217,6 @@ export const LROsDeleteProvisioning202Accepted200SucceededHeaders: coreHttp.Comp }; export const LROsDeleteProvisioning202DeletingFailed200Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteProvisioning202DeletingFailed200Headers", type: { name: "Composite", className: "LROsDeleteProvisioning202DeletingFailed200Headers", @@ -247,7 +228,6 @@ export const LROsDeleteProvisioning202DeletingFailed200Headers: coreHttp.Composi }; export const LROsDeleteProvisioning202Deletingcanceled200Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteProvisioning202Deletingcanceled200Headers", type: { name: "Composite", className: "LROsDeleteProvisioning202Deletingcanceled200Headers", @@ -259,7 +239,6 @@ export const LROsDeleteProvisioning202Deletingcanceled200Headers: coreHttp.Compo }; export const LROsDelete202Retry200Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_delete202Retry200Headers", type: { name: "Composite", className: "LROsDelete202Retry200Headers", @@ -271,7 +250,6 @@ export const LROsDelete202Retry200Headers: coreHttp.CompositeMapper = { }; export const LROsDelete202NoRetry204Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_delete202NoRetry204Headers", type: { name: "Composite", className: "LROsDelete202NoRetry204Headers", @@ -283,7 +261,6 @@ export const LROsDelete202NoRetry204Headers: coreHttp.CompositeMapper = { }; export const LROsDeleteNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteNoHeaderInRetryHeaders", type: { name: "Composite", className: "LROsDeleteNoHeaderInRetryHeaders", @@ -294,7 +271,6 @@ export const LROsDeleteNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { }; export const LROsDeleteAsyncNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteAsyncNoHeaderInRetryHeaders", type: { name: "Composite", className: "LROsDeleteAsyncNoHeaderInRetryHeaders", @@ -305,7 +281,6 @@ export const LROsDeleteAsyncNoHeaderInRetryHeaders: coreHttp.CompositeMapper = { }; export const LROsDeleteAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteAsyncRetrySucceededHeaders", type: { name: "Composite", className: "LROsDeleteAsyncRetrySucceededHeaders", @@ -321,7 +296,6 @@ export const LROsDeleteAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { }; export const LROsDeleteAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteAsyncNoRetrySucceededHeaders", type: { name: "Composite", className: "LROsDeleteAsyncNoRetrySucceededHeaders", @@ -337,7 +311,6 @@ export const LROsDeleteAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = }; export const LROsDeleteAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteAsyncRetryFailedHeaders", type: { name: "Composite", className: "LROsDeleteAsyncRetryFailedHeaders", @@ -353,7 +326,6 @@ export const LROsDeleteAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { }; export const LROsDeleteAsyncRetrycanceledHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_deleteAsyncRetrycanceledHeaders", type: { name: "Composite", className: "LROsDeleteAsyncRetrycanceledHeaders", @@ -369,7 +341,6 @@ export const LROsDeleteAsyncRetrycanceledHeaders: coreHttp.CompositeMapper = { }; export const LROsPost202Retry200Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_post202Retry200Headers", type: { name: "Composite", className: "LROsPost202Retry200Headers", @@ -381,7 +352,6 @@ export const LROsPost202Retry200Headers: coreHttp.CompositeMapper = { }; export const LROsPost202NoRetry204Headers: coreHttp.CompositeMapper = { - serializedName: "lROs_post202NoRetry204Headers", type: { name: "Composite", className: "LROsPost202NoRetry204Headers", @@ -393,7 +363,6 @@ export const LROsPost202NoRetry204Headers: coreHttp.CompositeMapper = { }; export const LROsPostAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_postAsyncRetrySucceededHeaders", type: { name: "Composite", className: "LROsPostAsyncRetrySucceededHeaders", @@ -409,7 +378,6 @@ export const LROsPostAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { }; export const LROsPostAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_postAsyncNoRetrySucceededHeaders", type: { name: "Composite", className: "LROsPostAsyncNoRetrySucceededHeaders", @@ -425,7 +393,6 @@ export const LROsPostAsyncNoRetrySucceededHeaders: coreHttp.CompositeMapper = { }; export const LROsPostAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_postAsyncRetryFailedHeaders", type: { name: "Composite", className: "LROsPostAsyncRetryFailedHeaders", @@ -441,7 +408,6 @@ export const LROsPostAsyncRetryFailedHeaders: coreHttp.CompositeMapper = { }; export const LROsPostAsyncRetrycanceledHeaders: coreHttp.CompositeMapper = { - serializedName: "lROs_postAsyncRetrycanceledHeaders", type: { name: "Composite", className: "LROsPostAsyncRetrycanceledHeaders", @@ -457,7 +423,6 @@ export const LROsPostAsyncRetrycanceledHeaders: coreHttp.CompositeMapper = { }; export const LRORetrysPutAsyncRelativeRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_putAsyncRelativeRetrySucceededHeaders", type: { name: "Composite", className: "LRORetrysPutAsyncRelativeRetrySucceededHeaders", @@ -473,7 +438,6 @@ export const LRORetrysPutAsyncRelativeRetrySucceededHeaders: coreHttp.CompositeM }; export const LRORetrysDeleteProvisioning202Accepted200SucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_deleteProvisioning202Accepted200SucceededHeaders", type: { name: "Composite", className: "LRORetrysDeleteProvisioning202Accepted200SucceededHeaders", @@ -485,7 +449,6 @@ export const LRORetrysDeleteProvisioning202Accepted200SucceededHeaders: coreHttp }; export const LRORetrysDelete202Retry200Headers: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_delete202Retry200Headers", type: { name: "Composite", className: "LRORetrysDelete202Retry200Headers", @@ -497,7 +460,6 @@ export const LRORetrysDelete202Retry200Headers: coreHttp.CompositeMapper = { }; export const LRORetrysDeleteAsyncRelativeRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_deleteAsyncRelativeRetrySucceededHeaders", type: { name: "Composite", className: "LRORetrysDeleteAsyncRelativeRetrySucceededHeaders", @@ -513,7 +475,6 @@ export const LRORetrysDeleteAsyncRelativeRetrySucceededHeaders: coreHttp.Composi }; export const LRORetrysPost202Retry200Headers: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_post202Retry200Headers", type: { name: "Composite", className: "LRORetrysPost202Retry200Headers", @@ -525,7 +486,6 @@ export const LRORetrysPost202Retry200Headers: coreHttp.CompositeMapper = { }; export const LRORetrysPostAsyncRelativeRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lRORetrys_postAsyncRelativeRetrySucceededHeaders", type: { name: "Composite", className: "LRORetrysPostAsyncRelativeRetrySucceededHeaders", @@ -541,7 +501,6 @@ export const LRORetrysPostAsyncRelativeRetrySucceededHeaders: coreHttp.Composite }; export const LrosaDsPutAsyncRelativeRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_putAsyncRelativeRetry400Headers", type: { name: "Composite", className: "LrosaDsPutAsyncRelativeRetry400Headers", @@ -557,7 +516,6 @@ export const LrosaDsPutAsyncRelativeRetry400Headers: coreHttp.CompositeMapper = }; export const LrosaDsDeleteNonRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_deleteNonRetry400Headers", type: { name: "Composite", className: "LrosaDsDeleteNonRetry400Headers", @@ -569,7 +527,6 @@ export const LrosaDsDeleteNonRetry400Headers: coreHttp.CompositeMapper = { }; export const LrosaDsDelete202NonRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_delete202NonRetry400Headers", type: { name: "Composite", className: "LrosaDsDelete202NonRetry400Headers", @@ -581,7 +538,6 @@ export const LrosaDsDelete202NonRetry400Headers: coreHttp.CompositeMapper = { }; export const LrosaDsDeleteAsyncRelativeRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_deleteAsyncRelativeRetry400Headers", type: { name: "Composite", className: "LrosaDsDeleteAsyncRelativeRetry400Headers", @@ -597,7 +553,6 @@ export const LrosaDsDeleteAsyncRelativeRetry400Headers: coreHttp.CompositeMapper }; export const LrosaDsPostNonRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_postNonRetry400Headers", type: { name: "Composite", className: "LrosaDsPostNonRetry400Headers", @@ -609,7 +564,6 @@ export const LrosaDsPostNonRetry400Headers: coreHttp.CompositeMapper = { }; export const LrosaDsPost202NonRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_post202NonRetry400Headers", type: { name: "Composite", className: "LrosaDsPost202NonRetry400Headers", @@ -621,7 +575,6 @@ export const LrosaDsPost202NonRetry400Headers: coreHttp.CompositeMapper = { }; export const LrosaDsPostAsyncRelativeRetry400Headers: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_postAsyncRelativeRetry400Headers", type: { name: "Composite", className: "LrosaDsPostAsyncRelativeRetry400Headers", @@ -637,7 +590,6 @@ export const LrosaDsPostAsyncRelativeRetry400Headers: coreHttp.CompositeMapper = }; export const LrosaDsPutAsyncRelativeRetryNoStatusHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_putAsyncRelativeRetryNoStatusHeaders", type: { name: "Composite", className: "LrosaDsPutAsyncRelativeRetryNoStatusHeaders", @@ -653,7 +605,6 @@ export const LrosaDsPutAsyncRelativeRetryNoStatusHeaders: coreHttp.CompositeMapp }; export const LrosaDsPutAsyncRelativeRetryNoStatusPayloadHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_putAsyncRelativeRetryNoStatusPayloadHeaders", type: { name: "Composite", className: "LrosaDsPutAsyncRelativeRetryNoStatusPayloadHeaders", @@ -669,7 +620,6 @@ export const LrosaDsPutAsyncRelativeRetryNoStatusPayloadHeaders: coreHttp.Compos }; export const LrosaDsDeleteAsyncRelativeRetryNoStatusHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_deleteAsyncRelativeRetryNoStatusHeaders", type: { name: "Composite", className: "LrosaDsDeleteAsyncRelativeRetryNoStatusHeaders", @@ -685,7 +635,6 @@ export const LrosaDsDeleteAsyncRelativeRetryNoStatusHeaders: coreHttp.CompositeM }; export const LrosaDsPost202NoLocationHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_post202NoLocationHeaders", type: { name: "Composite", className: "LrosaDsPost202NoLocationHeaders", @@ -697,7 +646,6 @@ export const LrosaDsPost202NoLocationHeaders: coreHttp.CompositeMapper = { }; export const LrosaDsPostAsyncRelativeRetryNoPayloadHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_postAsyncRelativeRetryNoPayloadHeaders", type: { name: "Composite", className: "LrosaDsPostAsyncRelativeRetryNoPayloadHeaders", @@ -713,7 +661,6 @@ export const LrosaDsPostAsyncRelativeRetryNoPayloadHeaders: coreHttp.CompositeMa }; export const LrosaDsPutAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_putAsyncRelativeRetryInvalidHeaderHeaders", type: { name: "Composite", className: "LrosaDsPutAsyncRelativeRetryInvalidHeaderHeaders", @@ -729,7 +676,6 @@ export const LrosaDsPutAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.Composit }; export const LrosaDsPutAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_putAsyncRelativeRetryInvalidJsonPollingHeaders", type: { name: "Composite", className: "LrosaDsPutAsyncRelativeRetryInvalidJsonPollingHeaders", @@ -745,7 +691,6 @@ export const LrosaDsPutAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp.Com }; export const LrosaDsDelete202RetryInvalidHeaderHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_delete202RetryInvalidHeaderHeaders", type: { name: "Composite", className: "LrosaDsDelete202RetryInvalidHeaderHeaders", @@ -757,7 +702,6 @@ export const LrosaDsDelete202RetryInvalidHeaderHeaders: coreHttp.CompositeMapper }; export const LrosaDsDeleteAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_deleteAsyncRelativeRetryInvalidHeaderHeaders", type: { name: "Composite", className: "LrosaDsDeleteAsyncRelativeRetryInvalidHeaderHeaders", @@ -773,7 +717,6 @@ export const LrosaDsDeleteAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.Compo }; export const LrosaDsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_deleteAsyncRelativeRetryInvalidJsonPollingHeaders", type: { name: "Composite", className: "LrosaDsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders", @@ -789,7 +732,6 @@ export const LrosaDsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp. }; export const LrosaDsPost202RetryInvalidHeaderHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_post202RetryInvalidHeaderHeaders", type: { name: "Composite", className: "LrosaDsPost202RetryInvalidHeaderHeaders", @@ -801,7 +743,6 @@ export const LrosaDsPost202RetryInvalidHeaderHeaders: coreHttp.CompositeMapper = }; export const LrosaDsPostAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_postAsyncRelativeRetryInvalidHeaderHeaders", type: { name: "Composite", className: "LrosaDsPostAsyncRelativeRetryInvalidHeaderHeaders", @@ -817,7 +758,6 @@ export const LrosaDsPostAsyncRelativeRetryInvalidHeaderHeaders: coreHttp.Composi }; export const LrosaDsPostAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp.CompositeMapper = { - serializedName: "lrosaDs_postAsyncRelativeRetryInvalidJsonPollingHeaders", type: { name: "Composite", className: "LrosaDsPostAsyncRelativeRetryInvalidJsonPollingHeaders", @@ -833,7 +773,6 @@ export const LrosaDsPostAsyncRelativeRetryInvalidJsonPollingHeaders: coreHttp.Co }; export const LROsCustomHeaderPutAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROsCustomHeader_putAsyncRetrySucceededHeaders", type: { name: "Composite", className: "LROsCustomHeaderPutAsyncRetrySucceededHeaders", @@ -849,7 +788,6 @@ export const LROsCustomHeaderPutAsyncRetrySucceededHeaders: coreHttp.CompositeMa }; export const LROsCustomHeaderPost202Retry200Headers: coreHttp.CompositeMapper = { - serializedName: "lROsCustomHeader_post202Retry200Headers", type: { name: "Composite", className: "LROsCustomHeaderPost202Retry200Headers", @@ -861,7 +799,6 @@ export const LROsCustomHeaderPost202Retry200Headers: coreHttp.CompositeMapper = }; export const LROsCustomHeaderPostAsyncRetrySucceededHeaders: coreHttp.CompositeMapper = { - serializedName: "lROsCustomHeader_postAsyncRetrySucceededHeaders", type: { name: "Composite", className: "LROsCustomHeaderPostAsyncRetrySucceededHeaders", diff --git a/test/integration/generated/lro/src/models/parameters.ts b/test/integration/generated/lro/src/models/parameters.ts index ba3d89dd8e..90b1b86b5e 100644 --- a/test/integration/generated/lro/src/models/parameters.ts +++ b/test/integration/generated/lro/src/models/parameters.ts @@ -13,8 +13,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts index dc28a06f72..51f773bd04 100644 --- a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts +++ b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts @@ -100,7 +100,7 @@ const analyzeBody$binaryOperationSpec: coreHttp.OperationSpec = { httpMethod: "POST", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } } }, requestBody: Parameters.input, @@ -113,7 +113,7 @@ const analyzeBody$jsonOperationSpec: coreHttp.OperationSpec = { httpMethod: "POST", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } } }, requestBody: Parameters.input1, diff --git a/test/integration/generated/mediaTypes/src/models/mappers.ts b/test/integration/generated/mediaTypes/src/models/mappers.ts index 9ea456e518..addea8f75e 100644 --- a/test/integration/generated/mediaTypes/src/models/mappers.ts +++ b/test/integration/generated/mediaTypes/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const SourcePath: coreHttp.CompositeMapper = { - serializedName: "SourcePath", type: { name: "Composite", className: "SourcePath", diff --git a/test/integration/generated/mediaTypes/src/models/parameters.ts b/test/integration/generated/mediaTypes/src/models/parameters.ts index 628b2a408b..174896347f 100644 --- a/test/integration/generated/mediaTypes/src/models/parameters.ts +++ b/test/integration/generated/mediaTypes/src/models/parameters.ts @@ -41,8 +41,8 @@ export const contentType1: coreHttp.OperationParameter = { parameterPath: "contentType", mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts index f4704ee903..4720efda12 100644 --- a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts +++ b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts @@ -246,8 +246,7 @@ const getArrayOperationSpec: coreHttp.OperationSpec = { element: { type: { name: "Composite", className: "FlattenedProduct" } } - }, - serializedName: "ArrayOfFlattenedProduct" + } } }, default: { @@ -280,8 +279,7 @@ const getWrappedArrayOperationSpec: coreHttp.OperationSpec = { type: { name: "Sequence", element: { type: { name: "Composite", className: "ProductWrapper" } } - }, - serializedName: "ArrayOfProductWrapper" + } } }, default: { @@ -314,8 +312,7 @@ const getDictionaryOperationSpec: coreHttp.OperationSpec = { type: { name: "Dictionary", value: { type: { name: "Composite", className: "FlattenedProduct" } } - }, - serializedName: "DictionaryOfFlattenedProduct" + } } }, default: { diff --git a/test/integration/generated/modelFlattening/src/models/mappers.ts b/test/integration/generated/modelFlattening/src/models/mappers.ts index ba5d611135..2d6ecd48f5 100644 --- a/test/integration/generated/modelFlattening/src/models/mappers.ts +++ b/test/integration/generated/modelFlattening/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const Resource: coreHttp.CompositeMapper = { - serializedName: "Resource", type: { name: "Composite", className: "Resource", @@ -21,10 +20,7 @@ export const Resource: coreHttp.CompositeMapper = { readOnly: true }, tags: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, + type: { name: "Dictionary", value: { type: { name: "String" } } }, serializedName: "tags" }, location: { type: { name: "String" }, serializedName: "location" }, @@ -34,7 +30,6 @@ export const Resource: coreHttp.CompositeMapper = { }; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", @@ -50,7 +45,6 @@ export const ErrorModel: coreHttp.CompositeMapper = { }; export const FlattenedProduct: coreHttp.CompositeMapper = { - serializedName: "FlattenedProduct", type: { name: "Composite", className: "FlattenedProduct", @@ -78,7 +72,6 @@ export const FlattenedProduct: coreHttp.CompositeMapper = { }; export const WrappedProduct: coreHttp.CompositeMapper = { - serializedName: "WrappedProduct", type: { name: "Composite", className: "WrappedProduct", @@ -89,7 +82,6 @@ export const WrappedProduct: coreHttp.CompositeMapper = { }; export const ProductWrapper: coreHttp.CompositeMapper = { - serializedName: "ProductWrapper", type: { name: "Composite", className: "ProductWrapper", @@ -100,7 +92,6 @@ export const ProductWrapper: coreHttp.CompositeMapper = { }; export const ResourceCollection: coreHttp.CompositeMapper = { - serializedName: "ResourceCollection", type: { name: "Composite", className: "ResourceCollection", @@ -130,7 +121,6 @@ export const ResourceCollection: coreHttp.CompositeMapper = { }; export const BaseProduct: coreHttp.CompositeMapper = { - serializedName: "BaseProduct", type: { name: "Composite", className: "BaseProduct", @@ -149,7 +139,6 @@ export const BaseProduct: coreHttp.CompositeMapper = { }; export const SimpleProduct: coreHttp.CompositeMapper = { - serializedName: "SimpleProduct", type: { name: "Composite", className: "SimpleProduct", @@ -161,9 +150,9 @@ export const SimpleProduct: coreHttp.CompositeMapper = { }, capacity: { type: { name: "String" }, - serializedName: "details.max_product_capacity", defaultValue: "Large", - isConstant: true + isConstant: true, + serializedName: "details.max_product_capacity" }, genericValue: { type: { name: "String" }, @@ -178,7 +167,6 @@ export const SimpleProduct: coreHttp.CompositeMapper = { }; export const GenericUrl: coreHttp.CompositeMapper = { - serializedName: "GenericUrl", type: { name: "Composite", className: "GenericUrl", @@ -192,7 +180,6 @@ export const GenericUrl: coreHttp.CompositeMapper = { }; export const ProductUrl: coreHttp.CompositeMapper = { - serializedName: "ProductUrl", type: { name: "Composite", className: "ProductUrl", diff --git a/test/integration/generated/modelFlattening/src/models/parameters.ts b/test/integration/generated/modelFlattening/src/models/parameters.ts index e97e607081..4635fd5277 100644 --- a/test/integration/generated/modelFlattening/src/models/parameters.ts +++ b/test/integration/generated/modelFlattening/src/models/parameters.ts @@ -13,8 +13,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/integration/generated/noMappers/src/noMappersClient.ts b/test/integration/generated/noMappers/src/noMappersClient.ts index a24af88dbf..ab91f92f15 100644 --- a/test/integration/generated/noMappers/src/noMappersClient.ts +++ b/test/integration/generated/noMappers/src/noMappersClient.ts @@ -46,7 +46,7 @@ const apiV1ValueGetOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: { type: { name: "String" }, serializedName: "String" } + bodyMapper: { type: { name: "String" } } } }, urlParameters: [Parameters.$host], diff --git a/test/integration/generated/paging/src/models/mappers.ts b/test/integration/generated/paging/src/models/mappers.ts index e811c1de9a..28bc22e5e3 100644 --- a/test/integration/generated/paging/src/models/mappers.ts +++ b/test/integration/generated/paging/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ProductResultValue: coreHttp.CompositeMapper = { - serializedName: "ProductResultValue", type: { name: "Composite", className: "ProductResultValue", @@ -27,7 +26,6 @@ export const ProductResultValue: coreHttp.CompositeMapper = { }; export const Product: coreHttp.CompositeMapper = { - serializedName: "Product", type: { name: "Composite", className: "Product", @@ -41,7 +39,6 @@ export const Product: coreHttp.CompositeMapper = { }; export const ProductProperties: coreHttp.CompositeMapper = { - serializedName: "ProductProperties", type: { name: "Composite", className: "ProductProperties", @@ -53,7 +50,6 @@ export const ProductProperties: coreHttp.CompositeMapper = { }; export const ProductResult: coreHttp.CompositeMapper = { - serializedName: "ProductResult", type: { name: "Composite", className: "ProductResult", @@ -71,7 +67,6 @@ export const ProductResult: coreHttp.CompositeMapper = { }; export const OdataProductResult: coreHttp.CompositeMapper = { - serializedName: "OdataProductResult", type: { name: "Composite", className: "OdataProductResult", @@ -92,7 +87,6 @@ export const OdataProductResult: coreHttp.CompositeMapper = { }; export const OperationResult: coreHttp.CompositeMapper = { - serializedName: "OperationResult", type: { name: "Composite", className: "OperationResult", diff --git a/test/integration/generated/report/src/models/mappers.ts b/test/integration/generated/report/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/report/src/models/mappers.ts +++ b/test/integration/generated/report/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/report/src/reportClient.ts b/test/integration/generated/report/src/reportClient.ts index 84e4d56ab2..2c6a3f4dfe 100644 --- a/test/integration/generated/report/src/reportClient.ts +++ b/test/integration/generated/report/src/reportClient.ts @@ -69,11 +69,7 @@ const getReportOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { @@ -90,11 +86,7 @@ const getOptionalReportOperationSpec: coreHttp.OperationSpec = { responses: { 200: { bodyMapper: { - type: { - name: "Dictionary", - value: { type: { name: "Number" }, serializedName: "Integer" } - }, - serializedName: "DictionaryOfInteger" + type: { name: "Dictionary", value: { type: { name: "Number" } } } } }, default: { diff --git a/test/integration/generated/url/src/models/mappers.ts b/test/integration/generated/url/src/models/mappers.ts index f5572cbdaa..367c0c5fac 100644 --- a/test/integration/generated/url/src/models/mappers.ts +++ b/test/integration/generated/url/src/models/mappers.ts @@ -9,7 +9,6 @@ import * as coreHttp from "@azure/core-http"; export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", type: { name: "Composite", className: "ErrorModel", diff --git a/test/integration/generated/url/src/models/parameters.ts b/test/integration/generated/url/src/models/parameters.ts index 9ca4f06af3..97b130f8da 100644 --- a/test/integration/generated/url/src/models/parameters.ts +++ b/test/integration/generated/url/src/models/parameters.ts @@ -25,8 +25,8 @@ export const boolPath: coreHttp.OperationURLParameter = { parameterPath: "boolPath", mapper: { defaultValue: true, - serializedName: "boolPath", isConstant: true, + serializedName: "boolPath", type: { name: "Boolean" } @@ -37,8 +37,8 @@ export const boolPath1: coreHttp.OperationURLParameter = { parameterPath: "boolPath", mapper: { defaultValue: false, - serializedName: "boolPath", isConstant: true, + serializedName: "boolPath", type: { name: "Boolean" } @@ -49,8 +49,8 @@ export const intPath: coreHttp.OperationURLParameter = { parameterPath: "intPath", mapper: { defaultValue: 1000000, - serializedName: "intPath", isConstant: true, + serializedName: "intPath", type: { name: "Number" } @@ -61,8 +61,8 @@ export const intPath1: coreHttp.OperationURLParameter = { parameterPath: "intPath", mapper: { defaultValue: -1000000, - serializedName: "intPath", isConstant: true, + serializedName: "intPath", type: { name: "Number" } @@ -73,8 +73,8 @@ export const longPath: coreHttp.OperationURLParameter = { parameterPath: "longPath", mapper: { defaultValue: 10000000000, - serializedName: "longPath", isConstant: true, + serializedName: "longPath", type: { name: "Number" } @@ -85,8 +85,8 @@ export const longPath1: coreHttp.OperationURLParameter = { parameterPath: "longPath", mapper: { defaultValue: -10000000000, - serializedName: "longPath", isConstant: true, + serializedName: "longPath", type: { name: "Number" } @@ -97,8 +97,8 @@ export const floatPath: coreHttp.OperationURLParameter = { parameterPath: "floatPath", mapper: { defaultValue: 103400000000000000000, - serializedName: "floatPath", isConstant: true, + serializedName: "floatPath", type: { name: "Number" } @@ -109,8 +109,8 @@ export const floatPath1: coreHttp.OperationURLParameter = { parameterPath: "floatPath", mapper: { defaultValue: -1.034e-20, - serializedName: "floatPath", isConstant: true, + serializedName: "floatPath", type: { name: "Number" } @@ -121,8 +121,8 @@ export const doublePath: coreHttp.OperationURLParameter = { parameterPath: "doublePath", mapper: { defaultValue: 9999999.999, - serializedName: "doublePath", isConstant: true, + serializedName: "doublePath", type: { name: "Number" } @@ -133,8 +133,8 @@ export const doublePath1: coreHttp.OperationURLParameter = { parameterPath: "doublePath", mapper: { defaultValue: -9999999.999, - serializedName: "doublePath", isConstant: true, + serializedName: "doublePath", type: { name: "Number" } @@ -145,8 +145,8 @@ export const stringPath: coreHttp.OperationURLParameter = { parameterPath: "stringPath", mapper: { defaultValue: "啊齄丂狛狜隣郎隣兀﨩", - serializedName: "stringPath", isConstant: true, + serializedName: "stringPath", type: { name: "String" } @@ -157,8 +157,8 @@ export const stringPath1: coreHttp.OperationURLParameter = { parameterPath: "stringPath", mapper: { defaultValue: "begin!*'();:@ &=+$,/?#[]end", - serializedName: "stringPath", isConstant: true, + serializedName: "stringPath", type: { name: "String" } @@ -169,8 +169,8 @@ export const stringPath2: coreHttp.OperationURLParameter = { parameterPath: "stringPath", mapper: { defaultValue: "begin!*'();:@&=+$,end", - serializedName: "stringPath", isConstant: true, + serializedName: "stringPath", type: { name: "String" } @@ -182,8 +182,8 @@ export const stringPath3: coreHttp.OperationURLParameter = { parameterPath: "stringPath", mapper: { defaultValue: "", - serializedName: "stringPath", isConstant: true, + serializedName: "stringPath", type: { name: "String" } @@ -240,8 +240,8 @@ export const bytePath1: coreHttp.OperationURLParameter = { parameterPath: "bytePath", mapper: { defaultValue: new Uint8Array(0), - serializedName: "bytePath", isConstant: true, + serializedName: "bytePath", type: { name: "ByteArray" } @@ -263,8 +263,8 @@ export const datePath: coreHttp.OperationURLParameter = { parameterPath: "datePath", mapper: { defaultValue: "2012-01-01", - serializedName: "datePath", isConstant: true, + serializedName: "datePath", type: { name: "Date" } @@ -286,8 +286,8 @@ export const dateTimePath: coreHttp.OperationURLParameter = { parameterPath: "dateTimePath", mapper: { defaultValue: "2012-01-01T01:01:01Z", - serializedName: "dateTimePath", isConstant: true, + serializedName: "dateTimePath", type: { name: "DateTime" } @@ -323,7 +323,7 @@ export const arrayPath: coreHttp.OperationURLParameter = { required: true, type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "Get0ItemsItem" } + element: { type: { name: "String" } } } } }; @@ -343,8 +343,8 @@ export const boolQuery: coreHttp.OperationQueryParameter = { parameterPath: "boolQuery", mapper: { defaultValue: true, - serializedName: "boolQuery", isConstant: true, + serializedName: "boolQuery", type: { name: "Boolean" } @@ -355,8 +355,8 @@ export const boolQuery1: coreHttp.OperationQueryParameter = { parameterPath: "boolQuery", mapper: { defaultValue: false, - serializedName: "boolQuery", isConstant: true, + serializedName: "boolQuery", type: { name: "Boolean" } @@ -377,8 +377,8 @@ export const intQuery: coreHttp.OperationQueryParameter = { parameterPath: "intQuery", mapper: { defaultValue: 1000000, - serializedName: "intQuery", isConstant: true, + serializedName: "intQuery", type: { name: "Number" } @@ -389,8 +389,8 @@ export const intQuery1: coreHttp.OperationQueryParameter = { parameterPath: "intQuery", mapper: { defaultValue: -1000000, - serializedName: "intQuery", isConstant: true, + serializedName: "intQuery", type: { name: "Number" } @@ -411,8 +411,8 @@ export const longQuery: coreHttp.OperationQueryParameter = { parameterPath: "longQuery", mapper: { defaultValue: 10000000000, - serializedName: "longQuery", isConstant: true, + serializedName: "longQuery", type: { name: "Number" } @@ -423,8 +423,8 @@ export const longQuery1: coreHttp.OperationQueryParameter = { parameterPath: "longQuery", mapper: { defaultValue: -10000000000, - serializedName: "longQuery", isConstant: true, + serializedName: "longQuery", type: { name: "Number" } @@ -445,8 +445,8 @@ export const floatQuery: coreHttp.OperationQueryParameter = { parameterPath: "floatQuery", mapper: { defaultValue: 103400000000000000000, - serializedName: "floatQuery", isConstant: true, + serializedName: "floatQuery", type: { name: "Number" } @@ -457,8 +457,8 @@ export const floatQuery1: coreHttp.OperationQueryParameter = { parameterPath: "floatQuery", mapper: { defaultValue: -1.034e-20, - serializedName: "floatQuery", isConstant: true, + serializedName: "floatQuery", type: { name: "Number" } @@ -479,8 +479,8 @@ export const doubleQuery: coreHttp.OperationQueryParameter = { parameterPath: "doubleQuery", mapper: { defaultValue: 9999999.999, - serializedName: "doubleQuery", isConstant: true, + serializedName: "doubleQuery", type: { name: "Number" } @@ -491,8 +491,8 @@ export const doubleQuery1: coreHttp.OperationQueryParameter = { parameterPath: "doubleQuery", mapper: { defaultValue: -9999999.999, - serializedName: "doubleQuery", isConstant: true, + serializedName: "doubleQuery", type: { name: "Number" } @@ -513,8 +513,8 @@ export const stringQuery: coreHttp.OperationQueryParameter = { parameterPath: "stringQuery", mapper: { defaultValue: "啊齄丂狛狜隣郎隣兀﨩", - serializedName: "stringQuery", isConstant: true, + serializedName: "stringQuery", type: { name: "String" } @@ -525,8 +525,8 @@ export const stringQuery1: coreHttp.OperationQueryParameter = { parameterPath: "stringQuery", mapper: { defaultValue: "begin!*'();:@ &=+$,/?#[]end", - serializedName: "stringQuery", isConstant: true, + serializedName: "stringQuery", type: { name: "String" } @@ -537,8 +537,8 @@ export const stringQuery2: coreHttp.OperationQueryParameter = { parameterPath: "stringQuery", mapper: { defaultValue: "", - serializedName: "stringQuery", isConstant: true, + serializedName: "stringQuery", type: { name: "String" } @@ -591,8 +591,8 @@ export const byteQuery1: coreHttp.OperationQueryParameter = { parameterPath: "byteQuery", mapper: { defaultValue: new Uint8Array(0), - serializedName: "byteQuery", isConstant: true, + serializedName: "byteQuery", type: { name: "ByteArray" } @@ -613,8 +613,8 @@ export const dateQuery: coreHttp.OperationQueryParameter = { parameterPath: "dateQuery", mapper: { defaultValue: "2012-01-01", - serializedName: "dateQuery", isConstant: true, + serializedName: "dateQuery", type: { name: "Date" } @@ -635,8 +635,8 @@ export const dateTimeQuery: coreHttp.OperationQueryParameter = { parameterPath: "dateTimeQuery", mapper: { defaultValue: "2012-01-01T01:01:01Z", - serializedName: "dateTimeQuery", isConstant: true, + serializedName: "dateTimeQuery", type: { name: "DateTime" } @@ -659,7 +659,7 @@ export const arrayQuery: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Csv @@ -671,7 +671,7 @@ export const arrayQuery1: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Csv @@ -683,7 +683,7 @@ export const arrayQuery2: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Csv @@ -695,7 +695,7 @@ export const arrayQuery3: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Ssv @@ -707,7 +707,7 @@ export const arrayQuery4: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Tsv @@ -719,7 +719,7 @@ export const arrayQuery5: coreHttp.OperationQueryParameter = { serializedName: "arrayQuery", type: { name: "Sequence", - element: { type: { name: "String" }, serializedName: "String" } + element: { type: { name: "String" } } } }, collectionFormat: coreHttp.QueryCollectionFormat.Pipes diff --git a/test/integration/generated/xmlservice/src/models/index.ts b/test/integration/generated/xmlservice/src/models/index.ts index 13a590bccf..ca41501aa0 100644 --- a/test/integration/generated/xmlservice/src/models/index.ts +++ b/test/integration/generated/xmlservice/src/models/index.ts @@ -372,7 +372,7 @@ export interface JsonOutput { } /** - * Defines headers for xml_getHeaders operation. + * Defines headers for Xml_getHeaders operation. */ export interface XmlGetHeadersHeaders { customHeader?: string; diff --git a/test/integration/generated/xmlservice/src/models/mappers.ts b/test/integration/generated/xmlservice/src/models/mappers.ts index 979bcb3fc5..d7f049fa85 100644 --- a/test/integration/generated/xmlservice/src/models/mappers.ts +++ b/test/integration/generated/xmlservice/src/models/mappers.ts @@ -128,13 +128,7 @@ export const Slide: coreHttp.CompositeMapper = { xmlName: "title" }, items: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "SlideItemsItem" - } - }, + type: { name: "Sequence", element: { type: { name: "String" } } }, serializedName: "items", xmlName: "items", xmlElementName: "item" @@ -170,26 +164,14 @@ export const AppleBarrel: coreHttp.CompositeMapper = { className: "AppleBarrel", modelProperties: { goodApples: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "AppleBarrelGoodApplesItem" - } - }, + type: { name: "Sequence", element: { type: { name: "String" } } }, serializedName: "GoodApples", xmlName: "GoodApples", xmlIsWrapped: true, xmlElementName: "Apple" }, badApples: { - type: { - name: "Sequence", - element: { - type: { name: "String" }, - serializedName: "AppleBarrelBadApplesItem" - } - }, + type: { name: "Sequence", element: { type: { name: "String" } } }, serializedName: "BadApples", xmlName: "BadApples", xmlIsWrapped: true, @@ -294,10 +276,7 @@ export const Container: coreHttp.CompositeMapper = { type: { name: "Composite", className: "ContainerProperties" } }, metadata: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, + type: { name: "Dictionary", value: { type: { name: "String" } } }, serializedName: "Metadata", xmlName: "Metadata" } @@ -719,10 +698,7 @@ export const Blob: coreHttp.CompositeMapper = { type: { name: "Composite", className: "BlobProperties" } }, metadata: { - type: { - name: "Dictionary", - value: { type: { name: "String" }, serializedName: "String" } - }, + type: { name: "Dictionary", value: { type: { name: "String" } } }, serializedName: "Metadata", xmlName: "Metadata" } @@ -920,7 +896,7 @@ export const JsonOutput: coreHttp.CompositeMapper = { }; export const XmlGetHeadersHeaders: coreHttp.CompositeMapper = { - serializedName: "xml_getHeadersHeaders", + serializedName: "Xml_getHeadersHeaders", type: { name: "Composite", className: "XmlGetHeadersHeaders", diff --git a/test/integration/generated/xmlservice/src/models/parameters.ts b/test/integration/generated/xmlservice/src/models/parameters.ts index e012c2d992..c83476b009 100644 --- a/test/integration/generated/xmlservice/src/models/parameters.ts +++ b/test/integration/generated/xmlservice/src/models/parameters.ts @@ -26,8 +26,8 @@ export const contentType: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/xml", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } @@ -83,8 +83,8 @@ export const comp: coreHttp.OperationQueryParameter = { parameterPath: "comp", mapper: { defaultValue: "list", - serializedName: "comp", isConstant: true, + serializedName: "comp", type: { name: "String" } @@ -95,8 +95,8 @@ export const comp1: coreHttp.OperationQueryParameter = { parameterPath: "comp", mapper: { defaultValue: "properties", - serializedName: "comp", isConstant: true, + serializedName: "comp", type: { name: "String" } @@ -107,8 +107,8 @@ export const restype: coreHttp.OperationQueryParameter = { parameterPath: "restype", mapper: { defaultValue: "service", - serializedName: "restype", isConstant: true, + serializedName: "restype", type: { name: "String" } @@ -124,8 +124,8 @@ export const comp2: coreHttp.OperationQueryParameter = { parameterPath: "comp", mapper: { defaultValue: "acl", - serializedName: "comp", isConstant: true, + serializedName: "comp", type: { name: "String" } @@ -136,8 +136,8 @@ export const restype1: coreHttp.OperationQueryParameter = { parameterPath: "restype", mapper: { defaultValue: "container", - serializedName: "restype", isConstant: true, + serializedName: "restype", type: { name: "String" } @@ -163,8 +163,8 @@ export const contentType1: coreHttp.OperationParameter = { parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", - serializedName: "Content-Type", isConstant: true, + serializedName: "Content-Type", type: { name: "String" } diff --git a/test/unit/transforms/mapperTransforms.spec.ts b/test/unit/transforms/mapperTransforms.spec.ts index cb2b2b769b..f179d41e27 100644 --- a/test/unit/transforms/mapperTransforms.spec.ts +++ b/test/unit/transforms/mapperTransforms.spec.ts @@ -93,20 +93,22 @@ describe("transformObjectMapper", () => { const stringSchema = getStringSchema("stringSchema"); const schema = getObjectSchema(objectName, { properties: [ - new Property(stringPropName, "", stringSchema, { required: true }) + new Property(stringPropName, "", stringSchema, { + required: true, + serializedName: "string-prop" + }) ] }); const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: objectName, type: { className: getMapperClassName(schema), name: MapperType.Composite, modelProperties: { stringProp: { - serializedName: "stringProp", + serializedName: "string-prop", required: true, type: { name: "String" @@ -127,19 +129,22 @@ describe("transformObjectMapper", () => { new ConstantValue(constantValue) ); const schema = getObjectSchema(objectName, { - properties: [new Property(propName, "", constantSchema)] + properties: [ + new Property(propName, "", constantSchema, { + serializedName: "constant-prop" + }) + ] }); const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: objectName, type: { name: MapperType.Composite, className: "MockObjectName", modelProperties: { constantProp: { - serializedName: "constantProp", + serializedName: "constant-prop", defaultValue: constantValue, isConstant: true, type: { @@ -164,19 +169,22 @@ describe("transformObjectMapper", () => { choices }); const schema = getObjectSchema(objectName, { - properties: [new Property(propName, "", choiceSchema)] + properties: [ + new Property(propName, "", choiceSchema, { + serializedName: "choice-prop" + }) + ] }); const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: objectName, type: { name: MapperType.Composite, className: getMapperClassName(schema), modelProperties: { choiceProp: { - serializedName: "choiceProp", + serializedName: "choice-prop", type: { name: "String" } @@ -196,16 +204,18 @@ describe("transformObjectMapper", () => { new Property( "length", "", - new NumberSchema("typeForlength", "", SchemaType.Number, 32) + new NumberSchema("typeForlength", "", SchemaType.Number, 32), + { serializedName: "length" } ), - new Property("siblings", "", new ArraySchema("Fish-siblings", "", fish)) + new Property("siblings", "", new ArraySchema("Fish-siblings", "", fish), { + serializedName: "siblings" + }) ]; fish.properties = properties; const mapper = transformMapper({ schema: fish }); assert.deepEqual(mapper, { - serializedName: "fish", type: { className: getMapperClassName(fish), modelProperties: { @@ -251,19 +261,22 @@ describe("transformObjectMapper", () => { properties: [new Property(childObjectProp, "", getStringSchema("foo"))] }); const schema = getObjectSchema(parentObjectName, { - properties: [new Property(propName, "", childObject)] + properties: [ + new Property(propName, "", childObject, { + serializedName: "object-prop" + }) + ] }); const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: parentObjectName, type: { className: getMapperClassName(schema), name: MapperType.Composite, modelProperties: { objectProp: { - serializedName: "objectProp", + serializedName: "object-prop", type: { name: "Composite", className: "MockChildObject" @@ -282,7 +295,6 @@ describe("transformPrimitiveMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: byteArrayName, type: { name: MapperType.ByteArray } @@ -295,7 +307,6 @@ describe("transformPrimitiveMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: byteArrayName, type: { name: MapperType.Base64Url } @@ -310,7 +321,6 @@ describe("transformPrimitiveMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: booleanSchemaName, type: { name: MapperType.Boolean } @@ -323,7 +333,6 @@ describe("transformPrimitiveMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: charSchemaName, type: { name: MapperType.String } @@ -346,7 +355,6 @@ describe("transformChoiceMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: choiceSchemaName, type: { name: MapperType.String } @@ -368,7 +376,6 @@ describe("transformChoiceMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: choiceSchemaName, type: { name: MapperType.Enum, allowedValues: choices.map(choice => choice.value) @@ -384,7 +391,6 @@ describe("transformDateMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: dateSchemaName, type: { name: "Date" } }); }); @@ -395,7 +401,6 @@ describe("transformDateMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: dateSchemaName, type: { name: "DateTime" } }); }); @@ -406,7 +411,6 @@ describe("transformDateMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: dateSchemaName, type: { name: "UnixTime" } }); }); @@ -422,7 +426,6 @@ describe("transformConstantMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: constantName, type: { name: "String" }, @@ -440,7 +443,6 @@ describe("transformConstantMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: constantName, type: { name: "Number" }, @@ -458,7 +460,6 @@ describe("transformConstantMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: constantName, type: { name: "Date" }, @@ -476,7 +477,6 @@ describe("transformConstantMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: constantName, type: { name: "DateTime" }, @@ -494,7 +494,6 @@ describe("transformConstantMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: constantName, type: { name: "UnixTime" }, @@ -510,7 +509,6 @@ describe("transformStringMapper", () => { const mapper = transformMapper({ schema }); assert.deepEqual(mapper, { - serializedName: stringSchemaName, type: { name: "String" } }); }); @@ -521,7 +519,6 @@ describe("transformStringMapper", () => { const mapper = transformMapper({ schema, options: { required: true } }); assert.deepEqual(mapper, { - serializedName: stringSchemaName, type: { name: "String" }, required: true, constraints: { @@ -537,7 +534,6 @@ describe("transformNumberMapper", () => { it("Gets a mapper from a non required NumberSchema", () => { const mapper = transformMapper({ schema: getNumberSchema() }); assert.deepEqual(mapper, { - serializedName: numberSchemaName, type: { name: "Number" } }); }); @@ -545,7 +541,6 @@ describe("transformNumberMapper", () => { it("Gets a mapper from a NumberSchema with constrains", () => { const mapper = transformMapper({ schema: getNumberSchema() }); assert.deepEqual(mapper, { - serializedName: numberSchemaName, type: { name: "Number" } }); }); @@ -556,7 +551,6 @@ describe("transformNumberMapper", () => { schema: getNumberSchema(undefined, constraints) }); assert.deepEqual(mapper, { - serializedName: numberSchemaName, type: { name: "Number" }, constraints: { InclusiveMaximum: constraints.maximum, @@ -638,7 +632,6 @@ describe("Mapper Transforms", () => { }) as CompositeMapper; const modelPropertiesKeys = Object.keys(mapper.type.modelProperties || {}); - assert.strictEqual(mapper.serializedName, "RefColorConstant"); assert.strictEqual(mapper.type.name, MapperType.Composite); assert.strictEqual(modelPropertiesKeys.length, 2); @@ -684,11 +677,6 @@ describe("Mapper Transforms", () => { const mapper = transformMapper({ schema: basicSchema }) as CompositeMapper; const modelPropertiesKeys = Object.keys(mapper.type.modelProperties || {}); - assert.strictEqual( - mapper.serializedName, - "basic", - "Unexpected serialized name" - ); assert.strictEqual( mapper.type.name, MapperType.Composite, @@ -717,11 +705,6 @@ describe("Mapper Transforms", () => { const mapper = transformMapper({ schema: errorSchema }) as CompositeMapper; const modelPropertiesKeys = Object.keys(mapper.type.modelProperties || {}); - assert.strictEqual( - mapper.serializedName, - "Error", - `Expected "Error" but got ${mapper.serializedName}` - ); assert.strictEqual( mapper.type.name, MapperType.Composite, diff --git a/test/unit/transforms/operationTransforms.spec.ts b/test/unit/transforms/operationTransforms.spec.ts index 59e9a4cd2d..72a335428e 100644 --- a/test/unit/transforms/operationTransforms.spec.ts +++ b/test/unit/transforms/operationTransforms.spec.ts @@ -172,7 +172,8 @@ describe("OperationTransforms", () => { const mockOperation = getOperation(okResponseSchema); const operationDetails = await transformOperation( mockOperation, - "MockOperationGroup" + { language: { default: { name: "MockOperationGroup" } } } as any, + "ClientName" ); const operationSpec = transformOperationSpec(operationDetails, [])[0]; checkHttpMethodAndPath(operationSpec); @@ -182,7 +183,8 @@ describe("OperationTransforms", () => { const mockOperation = getOperation(); const operationDetails = transformOperation( mockOperation, - "MockOperationGroup" + { language: { default: { name: "MockOperationGroup" } } } as any, + "ClientName" ); const operationSpec = transformOperationSpec( await operationDetails, @@ -204,14 +206,15 @@ describe("OperationTransforms", () => { ); const mockOperation = getOperation(undefined, [parameter]); - const operationDetails = transformOperation( + const operationDetails = await transformOperation( mockOperation, - "MockOperationGroup" + { language: { default: { name: "MockOperationGroup" } } } as any, + "ClientName" ); - const operationSpec = transformOperationSpec(await operationDetails, [ + const operationSpec = transformOperationSpec(operationDetails, [ { nameRef: "MockOperation", - operationsIn: ["mockoperationgroup_getnull"], + operationsIn: ["MockOperationGroup_getNull"], parameterPath: "mockOperation", isGlobal: false, mapper: "", @@ -238,7 +241,8 @@ describe("OperationTransforms", () => { const mockOperation = getOperation(okResponseSchema); const operationDetails = await transformOperation( mockOperation, - "MockOperationGroup" + { language: { default: { name: "MockOperationGroup" } } } as any, + "ClientName" ); const operationSpec = transformOperationSpec(operationDetails, [])[0]; checkHttpMethodAndPath(operationSpec); @@ -257,7 +261,8 @@ describe("OperationTransforms", () => { const mockOperation = getOperation(okResponseSchema); const operationDetails = await transformOperation( mockOperation, - "MockOperationGroup" + { language: { default: { name: "MockOperationGroup" } } } as any, + "ClientName" ); const operationSpec = transformOperationSpec(operationDetails, [])[0]; checkHttpMethodAndPath(operationSpec); diff --git a/test/unit/transforms/parameterTransforms.spec.ts b/test/unit/transforms/parameterTransforms.spec.ts index 198850c410..f44f25b5ac 100644 --- a/test/unit/transforms/parameterTransforms.spec.ts +++ b/test/unit/transforms/parameterTransforms.spec.ts @@ -5,14 +5,12 @@ import { StringSchema, NumberSchema, SchemaType, - Languages, OperationGroup, Request, ParameterLocation } from "@azure-tools/codemodel"; import { transformParameters } from "../../../src/transforms/parameterTransforms"; import { ParameterDetails } from "../../../src/models/parameterDetails"; -import { EntityOptions } from "../../../src/transforms/mapperTransforms"; import { ClientOptions } from "../../../src/models/clientDetails"; describe("parameterTransforms", () => { const getCodeModelWithOneParam = (paramOptions?: { @@ -173,8 +171,8 @@ describe("parameterTransforms", () => { p => p.nameRef === "mockParam1" )!; - assert.deepEqual(p1.operationsIn, ["operationgroup1_operation1"]); - assert.deepEqual(p2.operationsIn, ["operationgroup2_operation2"]); + assert.deepEqual(p1.operationsIn, ["OperationGroup1_operation1"]); + assert.deepEqual(p2.operationsIn, ["OperationGroup2_operation2"]); assert.equal(p1.parameter, param1); assert.equal(p2.parameter, param2); }); @@ -242,8 +240,8 @@ describe("parameterTransforms", () => { )!; assert.deepEqual(p1.operationsIn, [ - "operationgroup1_operation1", - "operationgroup2_operation2" + "OperationGroup1_operation1", + "OperationGroup2_operation2" ]); assert.equal(p1.parameter, param1); }); @@ -314,8 +312,8 @@ describe("parameterTransforms", () => { p => p.nameRef === "mockParam2" )!; - assert.deepEqual(p1.operationsIn, ["operationgroup1_operation1"]); - assert.deepEqual(p2.operationsIn, ["operationgroup1_operation1"]); + assert.deepEqual(p1.operationsIn, ["OperationGroup1_operation1"]); + assert.deepEqual(p2.operationsIn, ["OperationGroup1_operation1"]); assert.equal(p1.parameter, param1); assert.equal(p2.parameter, param2);