From 1a40a3af0698e124814c47d0ce026db55c39ca45 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Thu, 22 Feb 2024 15:05:44 +0800 Subject: [PATCH] migrate @projectedName to @encodedName (#4885) resolve: #4884 --- .../projectedName_2024-02-19-02-17.json | 10 + .../src/emiters/emit-client.ts | 24 ++- .../src/generate/generate-arm-resource.ts | 3 +- .../src/generate/generate-client.ts | 14 +- .../openapi-to-typespec/src/interfaces.ts | 4 +- .../src/transforms/transform-arm-resources.ts | 36 ++-- .../src/transforms/transform-object.ts | 6 +- .../src/utils/decorators.ts | 6 +- .../openapi-to-typespec/src/utils/imports.ts | 2 +- .../test/analyzeText/tsp-output/client.tsp | 3 - .../anomalyDetector/tsp-output/client.tsp | 3 - .../arm-agrifood/tsp-output/DataConnector.tsp | 4 +- .../tsp-output/DataManagerForAgriculture.tsp | 8 +- .../arm-agrifood/tsp-output/Extension.tsp | 4 +- .../tsp-output/PrivateEndpointConnection.tsp | 4 +- .../test/arm-agrifood/tsp-output/Solution.tsp | 4 +- .../test/arm-agrifood/tsp-output/client.tsp | 3 - .../arm-alertsmanagement/tsp-output/Alert.tsp | 5 +- .../tsp-output/AlertProcessingRule.tsp | 8 +- .../tsp-output/AnalysisServicesServer.tsp | 8 +- .../tsp-output/AccessInformationContract.tsp | 8 +- .../tsp-output/ApiContract.tsp | 8 +- .../ApiManagementServiceResource.tsp | 36 ++-- .../tsp-output/ApiReleaseContract.tsp | 8 +- .../tsp-output/ApiVersionSetContract.tsp | 8 +- .../AuthorizationServerContract.tsp | 8 +- .../tsp-output/BackendContract.tsp | 12 +- .../tsp-output/CacheContract.tsp | 8 +- .../tsp-output/CertificateContract.tsp | 4 +- .../tsp-output/DiagnosticContract.tsp | 8 +- .../tsp-output/EmailTemplateContract.tsp | 8 +- .../GatewayCertificateAuthorityContract.tsp | 4 +- .../tsp-output/GatewayContract.tsp | 16 +- .../GatewayHostnameConfigurationContract.tsp | 4 +- .../tsp-output/GlobalSchemaContract.tsp | 4 +- .../tsp-output/GroupContract.tsp | 8 +- .../tsp-output/IdentityProviderContract.tsp | 8 +- .../tsp-output/IssueAttachmentContract.tsp | 4 +- .../tsp-output/IssueCommentContract.tsp | 4 +- .../tsp-output/IssueContract.tsp | 8 +- .../tsp-output/LoggerContract.tsp | 8 +- .../tsp-output/NamedValueContract.tsp | 8 +- .../OpenidConnectProviderContract.tsp | 8 +- .../tsp-output/OperationContract.tsp | 8 +- .../tsp-output/PolicyContract.tsp | 4 +- .../tsp-output/PortalDelegationSettings.tsp | 9 +- .../tsp-output/PortalRevisionContract.tsp | 8 +- .../tsp-output/PortalSigninSettings.tsp | 9 +- .../tsp-output/PortalSignupSettings.tsp | 9 +- .../tsp-output/PrivateEndpointConnection.tsp | 4 +- .../tsp-output/ProductContract.tsp | 8 +- .../tsp-output/SchemaContract.tsp | 4 +- .../tsp-output/SubscriptionContract.tsp | 8 +- .../tsp-output/TagDescriptionContract.tsp | 4 +- .../tsp-output/UserContract.tsp | 12 +- .../arm-apimanagement/tsp-output/client.tsp | 8 + .../arm-apimanagement/tsp-output/models.tsp | 36 ++-- .../tsp-output/ProviderOperationsMetadata.tsp | 1 - .../tsp-output/RoleAssignment.tsp | 4 +- .../RoleAssignmentScheduleRequest.tsp | 8 +- .../tsp-output/RoleDefinition.tsp | 4 +- .../RoleEligibilityScheduleRequest.tsp | 8 +- .../tsp-output/RoleManagementPolicy.tsp | 4 +- .../RoleManagementPolicyAssignment.tsp | 4 +- .../arm-authorization/tsp-output/client.tsp | 4 + .../arm-authorization/tsp-output/models.tsp | 46 ++--- .../tsp-output/models.tsp | 2 +- .../tsp-output/AvailabilitySet.tsp | 8 +- .../tsp-output/CapacityReservation.tsp | 8 +- .../tsp-output/CapacityReservationGroup.tsp | 8 +- .../arm-compute/tsp-output/CloudService.tsp | 27 ++- .../arm-compute/tsp-output/DedicatedHost.tsp | 8 +- .../tsp-output/DedicatedHostGroup.tsp | 8 +- .../test/arm-compute/tsp-output/Disk.tsp | 12 +- .../arm-compute/tsp-output/DiskAccess.tsp | 8 +- .../tsp-output/DiskEncryptionSet.tsp | 8 +- .../tsp-output/DiskRestorePoint.tsp | 4 +- .../test/arm-compute/tsp-output/Gallery.tsp | 14 +- .../tsp-output/GalleryApplication.tsp | 8 +- .../tsp-output/GalleryApplicationVersion.tsp | 8 +- .../arm-compute/tsp-output/GalleryImage.tsp | 8 +- .../tsp-output/GalleryImageVersion.tsp | 8 +- .../test/arm-compute/tsp-output/Image.tsp | 9 +- .../tsp-output/PrivateEndpointConnection.tsp | 4 +- .../tsp-output/ProximityPlacementGroup.tsp | 8 +- .../arm-compute/tsp-output/RestorePoint.tsp | 4 +- .../tsp-output/RestorePointCollection.tsp | 8 +- .../test/arm-compute/tsp-output/Snapshot.tsp | 13 +- .../tsp-output/SshPublicKeyResource.tsp | 8 +- .../arm-compute/tsp-output/VirtualMachine.tsp | 26 ++- .../tsp-output/VirtualMachineExtension.tsp | 8 +- .../tsp-output/VirtualMachineRunCommand.tsp | 8 +- .../tsp-output/VirtualMachineScaleSet.tsp | 56 ++--- .../VirtualMachineScaleSetExtension.tsp | 8 +- .../tsp-output/VirtualMachineScaleSetVM.tsp | 12 +- .../VirtualMachineScaleSetVMExtension.tsp | 8 +- .../test/arm-compute/tsp-output/models.tsp | 20 +- .../test/arm-dns/tsp-output/DnsRecord.tsp | 9 +- .../test/arm-dns/tsp-output/DnsZone.tsp | 9 +- .../test/arm-dns/tsp-output/models.tsp | 38 ++-- .../BatchDeploymentTrackedResource.tsp | 8 +- .../BatchEndpointTrackedResource.tsp | 8 +- .../tsp-output/CodeContainerResource.tsp | 4 +- .../tsp-output/CodeVersionResource.tsp | 4 +- .../tsp-output/ComponentContainerResource.tsp | 4 +- .../tsp-output/ComponentVersionResource.tsp | 4 +- .../tsp-output/ComputeResource.tsp | 8 +- .../tsp-output/DataContainerResource.tsp | 4 +- .../tsp-output/DataVersionBaseResource.tsp | 4 +- .../tsp-output/DatastoreResource.tsp | 4 +- .../EnvironmentContainerResource.tsp | 4 +- .../tsp-output/EnvironmentVersionResource.tsp | 4 +- .../tsp-output/FeaturesetContainer.tsp | 4 +- .../tsp-output/FeaturesetVersion.tsp | 4 +- .../FeaturestoreEntityContainer.tsp | 4 +- .../tsp-output/FeaturestoreEntityVersion.tsp | 4 +- .../tsp-output/JobBaseResource.tsp | 9 +- .../tsp-output/LabelingJob.tsp | 4 +- .../tsp-output/ModelContainerResource.tsp | 4 +- .../tsp-output/ModelVersionResource.tsp | 4 +- .../OnlineDeploymentTrackedResource.tsp | 8 +- .../OnlineEndpointTrackedResource.tsp | 8 +- .../tsp-output/OutboundRuleBasicResource.tsp | 4 +- .../tsp-output/PrivateEndpointConnection.tsp | 4 +- .../tsp-output/Registry.tsp | 10 +- .../tsp-output/Schedule.tsp | 5 +- .../tsp-output/Workspace.tsp | 10 +- ...aceConnectionPropertiesV2BasicResource.tsp | 8 +- .../test/arm-sphere/tsp-output/Catalog.tsp | 4 +- .../arm-sphere/tsp-output/Certificate.tsp | 4 +- .../test/arm-sphere/tsp-output/Device.tsp | 4 +- .../arm-sphere/tsp-output/DeviceGroup.tsp | 4 +- .../arm-storage/tsp-output/BlobContainer.tsp | 21 +- .../tsp-output/BlobInventoryPolicy.tsp | 4 +- .../tsp-output/BlobServiceProperties.tsp | 5 +- .../tsp-output/EncryptionScope.tsp | 8 +- .../tsp-output/FileServiceProperties.tsp | 5 +- .../test/arm-storage/tsp-output/FileShare.tsp | 20 +- .../tsp-output/ImmutabilityPolicy.tsp | 8 +- .../test/arm-storage/tsp-output/LocalUser.tsp | 4 +- .../tsp-output/ManagementPolicy.tsp | 4 +- .../tsp-output/ObjectReplicationPolicy.tsp | 4 +- .../tsp-output/PrivateEndpointConnection.tsp | 4 +- .../tsp-output/QueueServiceProperties.tsp | 5 +- .../arm-storage/tsp-output/StorageAccount.tsp | 24 +-- .../arm-storage/tsp-output/StorageQueue.tsp | 10 +- .../test/arm-storage/tsp-output/Table.tsp | 10 +- .../tsp-output/TableServiceProperties.tsp | 5 +- .../test/arm-storage/tsp-output/client.tsp | 8 + .../test/arm-storage/tsp-output/models.tsp | 100 ++++----- .../test/batch/tsp-output/client.tsp | 3 - .../test/batch/tsp-output/models.tsp | 32 +-- .../test/bodyComplex/tsp-output/models.tsp | 10 +- .../test/complexObject/tsp-output/client.tsp | 3 - .../test/complexObject/tsp-output/models.tsp | 4 +- .../confidentialLedger/tsp-output/client.tsp | 3 - .../test/keyvault/tsp-output/models.tsp | 192 +++++++++--------- .../test/loadTest/tsp-output/client.tsp | 3 - .../test/nh/tsp-output/client.tsp | 3 - .../test/nh/tsp-output/models.tsp | 126 ++++++------ .../test/openAI/tsp-output/client.tsp | 3 - .../test/openAI/tsp-output/models.tsp | 26 +-- .../test/pagination/tsp-output/client.tsp | 3 - .../test/pagination/tsp-output/models.tsp | 4 +- .../test/qna/tsp-output/client.tsp | 3 - .../test/qna/tsp-output/models.tsp | 28 +-- .../test/qnaAuthoring/tsp-output/client.tsp | 3 - .../test/qnaRuntime/tsp-output/client.tsp | 3 - .../test/schemaRegistry/tsp-output/client.tsp | 3 - .../test/url/tsp-output/client.tsp | 3 - .../test/webpubsub/tsp-output/client.tsp | 3 - 171 files changed, 972 insertions(+), 884 deletions(-) create mode 100644 common/changes/@autorest/openapi-to-typespec/projectedName_2024-02-19-02-17.json delete mode 100644 packages/extensions/openapi-to-typespec/test/analyzeText/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/anomalyDetector/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/batch/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/confidentialLedger/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/loadTest/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/nh/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/openAI/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/pagination/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/qna/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/qnaAuthoring/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/qnaRuntime/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/schemaRegistry/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/url/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/webpubsub/tsp-output/client.tsp diff --git a/common/changes/@autorest/openapi-to-typespec/projectedName_2024-02-19-02-17.json b/common/changes/@autorest/openapi-to-typespec/projectedName_2024-02-19-02-17.json new file mode 100644 index 000000000..87410db5b --- /dev/null +++ b/common/changes/@autorest/openapi-to-typespec/projectedName_2024-02-19-02-17.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@autorest/openapi-to-typespec", + "comment": "migrate `@projectedName` to `@encodedName`", + "type": "patch" + } + ], + "packageName": "@autorest/openapi-to-typespec" +} \ No newline at end of file diff --git a/packages/extensions/openapi-to-typespec/src/emiters/emit-client.ts b/packages/extensions/openapi-to-typespec/src/emiters/emit-client.ts index a7aa5120c..78b17bce0 100644 --- a/packages/extensions/openapi-to-typespec/src/emiters/emit-client.ts +++ b/packages/extensions/openapi-to-typespec/src/emiters/emit-client.ts @@ -1,6 +1,7 @@ import { getSession } from "../autorest-session"; -import { generateObjectClientDecorator } from "../generate/generate-client"; +import { generateArmResourceClientDecorator, generateObjectClientDecorator } from "../generate/generate-client"; import { TypespecProgram } from "../interfaces"; +import { getOptions } from "../options"; import { formatTypespecFile } from "../utils/format"; import { getClientImports } from "../utils/imports"; import { getNamespace } from "../utils/namespace"; @@ -8,16 +9,33 @@ import { getNamespace } from "../utils/namespace"; export async function emitClient(filePath: string, program: TypespecProgram): Promise { const content = generateClient(program); + if (content === "") { + return; + } const session = getSession(); session.writeFile({ filename: filePath, content: await formatTypespecFile(content, filePath) }); } function generateClient(program: TypespecProgram) { + const { isArm } = getOptions(); const { models } = program; const { modules, namespaces: namespacesSet } = getClientImports(program); const imports = [...new Set([`import "./main.tsp";`, ...modules])].join("\n"); const namespaces = [...new Set([...namespacesSet, `using ${getNamespace(program)};`])].join("\n"); - const objects = models.objects.map(generateObjectClientDecorator).join("\n\n"); - return [imports, "\n", namespaces, "\n", objects].join("\n"); + const objects = models.objects + .map(generateObjectClientDecorator) + .filter((r) => r !== "") + .join("\n\n"); + + const armResources = isArm + ? models.armResources + .map(generateArmResourceClientDecorator) + .filter((r) => r !== "") + .join("\n\n") + : ""; + if (objects === "" && armResources === "") { + return ""; + } + return [imports, "\n", namespaces, "\n", objects, "\n", armResources].join("\n"); } diff --git a/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts b/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts index 76496cf54..ed330ef2f 100644 --- a/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts +++ b/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts @@ -21,7 +21,7 @@ export function generateArmResource(resource: TspArmResource): string { definitions.push("\n"); for (const o of resource.resourceOperations) { - for (const d of o.augmentedDecorators ?? []) { + for (const d of o.customizations ?? []) { definitions.push(`${d}`); } } @@ -107,7 +107,6 @@ function generateArmResourceOperation(resource: TspArmResource): string { definitions.push("@armResourceOperations"); if (resource.name === formalOperationGroupName) { - definitions.push(`@projectedName("client", "${formalOperationGroupName}")`); definitions.push(`interface ${formalOperationGroupName}OperationGroup {`); } else { definitions.push(`interface ${formalOperationGroupName} {`); diff --git a/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts b/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts index 0be75bbf2..c34001208 100644 --- a/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts +++ b/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts @@ -1,4 +1,5 @@ -import { TypespecObject } from "../interfaces"; +import pluralize from "pluralize"; +import { TspArmResource, TypespecObject } from "../interfaces"; import { generateAugmentedDecorators } from "../utils/decorators"; export function generateObjectClientDecorator(typespecObject: TypespecObject) { @@ -7,10 +8,19 @@ export function generateObjectClientDecorator(typespecObject: TypespecObject) { for (const property of typespecObject.properties) { const decorators = generateAugmentedDecorators( `${typespecObject.name}.${property.name}`, - property.augmentedDecorators, + property.clientDecorators, ); decorators && definitions.push(decorators); } return definitions.join("\n"); } + +export function generateArmResourceClientDecorator(resource: TspArmResource): string { + const formalOperationGroupName = pluralize(resource.name); + + if (resource.name === formalOperationGroupName) { + return `@@clientName(${formalOperationGroupName}OperationGroup, "${formalOperationGroupName}")`; + } + return ""; +} diff --git a/packages/extensions/openapi-to-typespec/src/interfaces.ts b/packages/extensions/openapi-to-typespec/src/interfaces.ts index 2a3c4d650..613119462 100644 --- a/packages/extensions/openapi-to-typespec/src/interfaces.ts +++ b/packages/extensions/openapi-to-typespec/src/interfaces.ts @@ -146,7 +146,7 @@ export interface TypespecObjectProperty extends TypespecDataType { isOptional: boolean; type: string; decorators?: TypespecDecorator[]; - augmentedDecorators?: TypespecDecorator[]; + clientDecorators?: TypespecDecorator[]; defaultValue?: any; } @@ -202,7 +202,7 @@ export interface TspArmResourceOperationBase extends WithDoc, WithFixMe { decorators?: TypespecDecorator[]; operationId?: string; examples?: Record>; - augmentedDecorators?: string[]; + customizations?: string[]; } export type TspArmResourceOperation = diff --git a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts index e3cb2c918..a3f5e50fd 100644 --- a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts +++ b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts @@ -244,18 +244,18 @@ function convertResourceCreateOrReplaceOperation( } const tspOperationGroupName = getTSPOperationGroupName(resourceMetadata.SwaggerModelName); const operationName = getOperationName(operation.OperationID); - const augmentedDecorators = []; + const customizations = []; if (bodyParam) { if (bodyParam.language.default.name !== "resource") { - augmentedDecorators.push( - `@@projectedName(${tspOperationGroupName}.\`${operationName}\`::parameters.resource, "json", "${bodyParam.language.default.name}");`, + customizations.push( + `@@encodedName(${tspOperationGroupName}.\`${operationName}\`::parameters.resource, "application/json", "${bodyParam.language.default.name}");`, ); - augmentedDecorators.push( + customizations.push( `@@extension(${tspOperationGroupName}.\`${operationName}\`::parameters.resource, "x-ms-client-name", "${bodyParam.language.default.name}");`, ); } if (bodyParam.language.default.description !== "Resource create parameters.") { - augmentedDecorators.push( + customizations.push( `@@doc(${tspOperationGroupName}.\`${operationName}\`::parameters.resource, "${bodyParam.language.default.description}");`, ); } @@ -268,7 +268,7 @@ function convertResourceCreateOrReplaceOperation( operationId: operation.OperationID, templateParameters: templateParameters, examples: swaggerOperation.extensions?.["x-ms-examples"], - augmentedDecorators, + customizations, }, ]; } @@ -297,7 +297,7 @@ function convertResourceUpdateOperation( } let kind; const templateParameters = [resourceMetadata.SwaggerModelName]; - const augmentedDecorators = []; + const customizations = []; if (bodyParam) { kind = isLongRunning ? "ArmCustomPatchAsync" : "ArmCustomPatchSync"; templateParameters.push(bodyParam.schema.language.default.name); @@ -305,15 +305,15 @@ function convertResourceUpdateOperation( const tspOperationGroupName = getTSPOperationGroupName(resourceMetadata.SwaggerModelName); const operationName = getOperationName(operation.OperationID); if (bodyParam.language.default.name !== "properties") { - augmentedDecorators.push( - `@@projectedName(${tspOperationGroupName}.\`${operationName}\`::parameters.properties, "json", "${bodyParam.language.default.name}");`, + customizations.push( + `@@encodedName(${tspOperationGroupName}.\`${operationName}\`::parameters.properties, "application/json", "${bodyParam.language.default.name}");`, ); - augmentedDecorators.push( + customizations.push( `@@extension(${tspOperationGroupName}.\`${operationName}\`::parameters.properties, "x-ms-client-name", "${bodyParam.language.default.name}");`, ); } if (bodyParam.language.default.description !== "The resource properties to be updated.") { - augmentedDecorators.push( + customizations.push( `@@doc(${tspOperationGroupName}.\`${operationName}\`::parameters.properties, "${bodyParam.language.default.description}");`, ); } @@ -333,7 +333,7 @@ function convertResourceUpdateOperation( operationId: operation.OperationID, templateParameters, examples: swaggerOperation.extensions?.["x-ms-examples"], - augmentedDecorators, + customizations, // To resolve auto-generate update model with proper visibility decorators: [{ name: "parameterVisibility", arguments: ["read"] }], }, @@ -525,18 +525,18 @@ function convertResourceActionOperations( const tspOperationGroupName = getTSPOperationGroupName(resourceMetadata.SwaggerModelName); const operationName = getOperationName(operation.OperationID); - const augmentedDecorators = []; + const customizations = []; if (bodyParam) { if (bodyParam.language.default.name !== "body") { - augmentedDecorators.push( - `@@projectedName(${tspOperationGroupName}.\`${operationName}\`::parameters.body, "json", "${bodyParam.language.default.name}");`, + customizations.push( + `@@encodedName(${tspOperationGroupName}.\`${operationName}\`::parameters.body, "application/json", "${bodyParam.language.default.name}");`, ); - augmentedDecorators.push( + customizations.push( `@@extension(${tspOperationGroupName}.\`${operationName}\`::parameters.body, "x-ms-client-name", "${bodyParam.language.default.name}");`, ); } if (bodyParam.language.default.description !== "The content of the action request") { - augmentedDecorators.push( + customizations.push( `@@doc(${tspOperationGroupName}.\`${operationName}\`::parameters.body, "${bodyParam.language.default.description}");`, ); } @@ -548,7 +548,7 @@ function convertResourceActionOperations( operationId: operation.OperationID, templateParameters, examples: swaggerOperation.extensions?.["x-ms-examples"], - augmentedDecorators, + customizations, }); } } diff --git a/packages/extensions/openapi-to-typespec/src/transforms/transform-object.ts b/packages/extensions/openapi-to-typespec/src/transforms/transform-object.ts index cc7d6bd64..6c0b5b5ae 100644 --- a/packages/extensions/openapi-to-typespec/src/transforms/transform-object.ts +++ b/packages/extensions/openapi-to-typespec/src/transforms/transform-object.ts @@ -14,7 +14,7 @@ import { get } from "lodash"; import { getDataTypes } from "../data-types"; import { TypespecObject, TypespecObjectProperty } from "../interfaces"; import { addCorePageAlias } from "../utils/alias"; -import { getModelDecorators, getPropertyAugmentedDecorators, getPropertyDecorators } from "../utils/decorators"; +import { getModelDecorators, getPropertyClientDecorators, getPropertyDecorators } from "../utils/decorators"; import { getDiscriminator, getOwnDiscriminator } from "../utils/discriminator"; import { getLogger } from "../utils/logger"; import { @@ -127,7 +127,7 @@ export function transformObjectProperty(propertySchema: Property, codeModel: Cod isOptional: propertySchema.required !== true, type: visited.name, decorators: getPropertyDecorators(propertySchema), - augmentedDecorators: getPropertyAugmentedDecorators(propertySchema), + clientDecorators: getPropertyClientDecorators(propertySchema), defaultValue: getDefaultValue(visited.name, propertySchema.schema), }; } @@ -144,7 +144,7 @@ export function transformObjectProperty(propertySchema: Property, codeModel: Cod isOptional: propertySchema.required !== true, type, decorators: getPropertyDecorators(propertySchema), - augmentedDecorators: getPropertyAugmentedDecorators(propertySchema), + clientDecorators: getPropertyClientDecorators(propertySchema), fixMe: getFixme(propertySchema, codeModel), defaultValue: getDefaultValue(type, propertySchema.schema), }; diff --git a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts index a06d07a50..fddf1eedb 100644 --- a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts +++ b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts @@ -132,15 +132,15 @@ export function getPropertyDecorators(element: Property | Parameter): TypespecDe if (!isParameter(element) && element.serializedName !== element.language.default.name) { decorators.push({ - name: "projectedName", - arguments: ["json", (element as Property).serializedName], + name: "encodedName", + arguments: ["application/json", (element as Property).serializedName], }); } return decorators; } -export function getPropertyAugmentedDecorators(element: Property | Parameter): TypespecDecorator[] { +export function getPropertyClientDecorators(element: Property | Parameter): TypespecDecorator[] { const decorators: TypespecDecorator[] = []; if (element.extensions?.["x-ms-client-flatten"]) { diff --git a/packages/extensions/openapi-to-typespec/src/utils/imports.ts b/packages/extensions/openapi-to-typespec/src/utils/imports.ts index c51c52cd2..bff41f371 100644 --- a/packages/extensions/openapi-to-typespec/src/utils/imports.ts +++ b/packages/extensions/openapi-to-typespec/src/utils/imports.ts @@ -48,7 +48,7 @@ export function getClientImports(program: TypespecProgram) { const namespaces = new Set(); for (const model of program.models.objects) { for (const property of model.properties) { - for (const decorator of property.augmentedDecorators ?? []) { + for (const decorator of property.clientDecorators ?? []) { decorator.module && modules.add(`import "${decorator.module}";`); decorator.namespace && namespaces.add(`using ${decorator.namespace};`); } diff --git a/packages/extensions/openapi-to-typespec/test/analyzeText/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/analyzeText/tsp-output/client.tsp deleted file mode 100644 index 351ef61b8..000000000 --- a/packages/extensions/openapi-to-typespec/test/analyzeText/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.Language.Authoring; diff --git a/packages/extensions/openapi-to-typespec/test/anomalyDetector/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/anomalyDetector/tsp-output/client.tsp deleted file mode 100644 index bd9016fa1..000000000 --- a/packages/extensions/openapi-to-typespec/test/anomalyDetector/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using AnomalyDetectorClient; diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp index 8f0ba5db8..a70cdc0a5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp @@ -86,8 +86,8 @@ interface DataConnectors { >; } -@@projectedName(DataConnectors.createOrUpdate::parameters.resource, - "json", +@@encodedName(DataConnectors.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(DataConnectors.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp index 065df482b..11605b34a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp @@ -111,8 +111,8 @@ interface DataManagerForAgricultures { listBySubscription is ArmListBySubscription; } -@@projectedName(DataManagerForAgricultures.createOrUpdate::parameters.resource, - "json", +@@encodedName(DataManagerForAgricultures.createOrUpdate::parameters.resource, + "application/json", "request" ); @@extension(DataManagerForAgricultures.createOrUpdate::parameters.resource, @@ -122,8 +122,8 @@ interface DataManagerForAgricultures { @@doc(DataManagerForAgricultures.createOrUpdate::parameters.resource, "Data Manager For Agriculture resource create or update request object." ); -@@projectedName(DataManagerForAgricultures.update::parameters.properties, - "json", +@@encodedName(DataManagerForAgricultures.update::parameters.properties, + "application/json", "request" ); @@extension(DataManagerForAgricultures.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp index 2161f75ca..25b785ac1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp @@ -102,8 +102,8 @@ interface Extensions { >; } -@@projectedName(Extensions.createOrUpdate::parameters.resource, - "json", +@@encodedName(Extensions.createOrUpdate::parameters.resource, + "application/json", "requestBody" ); @@extension(Extensions.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp index 1adb39b3b..4362df2db 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp @@ -64,8 +64,8 @@ interface PrivateEndpointConnections { listByResource is ArmResourceListByParent; } -@@projectedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, - "json", +@@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, + "application/json", "request" ); @@extension(PrivateEndpointConnections.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp index d07230b64..047461bc7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp @@ -155,8 +155,8 @@ interface Solutions { >; } -@@projectedName(Solutions.createOrUpdate::parameters.resource, - "json", +@@encodedName(Solutions.createOrUpdate::parameters.resource, + "application/json", "requestBody" ); @@extension(Solutions.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp deleted file mode 100644 index 4b16e4947..000000000 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.ResourceManager.AgFoodPlatform; diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp index 65b10d288..bbe5921a2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp @@ -200,6 +200,9 @@ interface Alerts { >; } -@@projectedName(Alerts.changeState::parameters.body, "json", "comment"); +@@encodedName(Alerts.changeState::parameters.body, + "application/json", + "comment" +); @@extension(Alerts.changeState::parameters.body, "x-ms-client-name", "comment"); @@doc(Alerts.changeState::parameters.body, "reason of change alert state"); diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp index ba47f33b7..cc4a930fc 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp @@ -73,8 +73,8 @@ interface AlertProcessingRules { listBySubscription is ArmListBySubscription; } -@@projectedName(AlertProcessingRules.createOrUpdate::parameters.resource, - "json", +@@encodedName(AlertProcessingRules.createOrUpdate::parameters.resource, + "application/json", "alertProcessingRule" ); @@extension(AlertProcessingRules.createOrUpdate::parameters.resource, @@ -84,8 +84,8 @@ interface AlertProcessingRules { @@doc(AlertProcessingRules.createOrUpdate::parameters.resource, "Alert processing rule to be created/updated." ); -@@projectedName(AlertProcessingRules.update::parameters.properties, - "json", +@@encodedName(AlertProcessingRules.update::parameters.properties, + "application/json", "alertProcessingRulePatch" ); @@extension(AlertProcessingRules.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp index 310c1a696..2627e6152 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp @@ -176,8 +176,8 @@ interface AnalysisServicesServers { >; } -@@projectedName(AnalysisServicesServers.create::parameters.resource, - "json", +@@encodedName(AnalysisServicesServers.create::parameters.resource, + "application/json", "serverParameters" ); @@extension(AnalysisServicesServers.create::parameters.resource, @@ -187,8 +187,8 @@ interface AnalysisServicesServers { @@doc(AnalysisServicesServers.create::parameters.resource, "Contains the information used to provision the Analysis Services server." ); -@@projectedName(AnalysisServicesServers.update::parameters.properties, - "json", +@@encodedName(AnalysisServicesServers.update::parameters.properties, + "application/json", "serverUpdateParameters" ); @@extension(AnalysisServicesServers.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp index 19a78dd98..251cc83a3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp @@ -169,8 +169,8 @@ interface AccessInformationContracts { >; } -@@projectedName(AccessInformationContracts.create::parameters.resource, - "json", +@@encodedName(AccessInformationContracts.create::parameters.resource, + "application/json", "parameters" ); @@extension(AccessInformationContracts.create::parameters.resource, @@ -180,8 +180,8 @@ interface AccessInformationContracts { @@doc(AccessInformationContracts.create::parameters.resource, "Parameters supplied to retrieve the Tenant Access Information." ); -@@projectedName(AccessInformationContracts.update::parameters.properties, - "json", +@@encodedName(AccessInformationContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(AccessInformationContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp index 9cb90c396..faa3cf4b2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp @@ -355,8 +355,8 @@ interface ApiContracts { >; } -@@projectedName(ApiContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(ApiContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ApiContracts.createOrUpdate::parameters.resource, @@ -366,8 +366,8 @@ interface ApiContracts { @@doc(ApiContracts.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(ApiContracts.update::parameters.properties, - "json", +@@encodedName(ApiContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(ApiContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp index 352a72868..c606302a5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp @@ -1371,8 +1371,8 @@ interface ApiManagementServiceResources { >; } -@@projectedName(ApiManagementServiceResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(ApiManagementServiceResources.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.createOrUpdate::parameters.resource, @@ -1382,8 +1382,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.createOrUpdate::parameters.resource, "Parameters supplied to the CreateOrUpdate API Management service operation." ); -@@projectedName(ApiManagementServiceResources.update::parameters.properties, - "json", +@@encodedName(ApiManagementServiceResources.update::parameters.properties, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.update::parameters.properties, @@ -1393,8 +1393,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.update::parameters.properties, "Parameters supplied to the CreateOrUpdate API Management service operation." ); -@@projectedName(ApiManagementServiceResources.performConnectivityCheckAsync::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.performConnectivityCheckAsync::parameters.body, + "application/json", "connectivityCheckRequestParams" ); @@extension(ApiManagementServiceResources.performConnectivityCheckAsync::parameters.body, @@ -1404,8 +1404,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.performConnectivityCheckAsync::parameters.body, "Connectivity Check request parameters." ); -@@projectedName(ApiManagementServiceResources.restore::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.restore::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.restore::parameters.body, @@ -1415,8 +1415,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.restore::parameters.body, "Parameters supplied to the Restore API Management service from backup operation." ); -@@projectedName(ApiManagementServiceResources.backup::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.backup::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.backup::parameters.body, @@ -1426,8 +1426,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.backup::parameters.body, "Parameters supplied to the ApiManagementService_Backup operation." ); -@@projectedName(ApiManagementServiceResources.applyNetworkConfigurationUpdates::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.applyNetworkConfigurationUpdates::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.applyNetworkConfigurationUpdates::parameters.body, @@ -1437,8 +1437,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.applyNetworkConfigurationUpdates::parameters.body, "Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in the region." ); -@@projectedName(ApiManagementServiceResources.deploy::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.deploy::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.deploy::parameters.body, @@ -1448,8 +1448,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.deploy::parameters.body, "Deploy Configuration parameters." ); -@@projectedName(ApiManagementServiceResources.save::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.save::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.save::parameters.body, @@ -1459,8 +1459,8 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResources.save::parameters.body, "Save Configuration parameters." ); -@@projectedName(ApiManagementServiceResources.validate::parameters.body, - "json", +@@encodedName(ApiManagementServiceResources.validate::parameters.body, + "application/json", "parameters" ); @@extension(ApiManagementServiceResources.validate::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp index 9d1bc1c02..9e28f034d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp @@ -150,8 +150,8 @@ interface ApiReleaseContracts { >; } -@@projectedName(ApiReleaseContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(ApiReleaseContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ApiReleaseContracts.createOrUpdate::parameters.resource, @@ -161,8 +161,8 @@ interface ApiReleaseContracts { @@doc(ApiReleaseContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(ApiReleaseContracts.update::parameters.properties, - "json", +@@encodedName(ApiReleaseContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(ApiReleaseContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp index ba145d4ad..304113e1e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp @@ -152,8 +152,8 @@ interface ApiVersionSetContracts { >; } -@@projectedName(ApiVersionSetContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(ApiVersionSetContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ApiVersionSetContracts.createOrUpdate::parameters.resource, @@ -163,8 +163,8 @@ interface ApiVersionSetContracts { @@doc(ApiVersionSetContracts.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(ApiVersionSetContracts.update::parameters.properties, - "json", +@@encodedName(ApiVersionSetContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(ApiVersionSetContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp index 66e46debc..06ead68a8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp @@ -163,8 +163,8 @@ interface AuthorizationServerContracts { >; } -@@projectedName(AuthorizationServerContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(AuthorizationServerContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(AuthorizationServerContracts.createOrUpdate::parameters.resource, @@ -174,8 +174,8 @@ interface AuthorizationServerContracts { @@doc(AuthorizationServerContracts.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(AuthorizationServerContracts.update::parameters.properties, - "json", +@@encodedName(AuthorizationServerContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(AuthorizationServerContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp index a4b918638..2278cc7ee 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp @@ -159,8 +159,8 @@ interface BackendContracts { >; } -@@projectedName(BackendContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(BackendContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(BackendContracts.createOrUpdate::parameters.resource, @@ -170,8 +170,8 @@ interface BackendContracts { @@doc(BackendContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(BackendContracts.update::parameters.properties, - "json", +@@encodedName(BackendContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(BackendContracts.update::parameters.properties, @@ -179,8 +179,8 @@ interface BackendContracts { "parameters" ); @@doc(BackendContracts.update::parameters.properties, "Update parameters."); -@@projectedName(BackendContracts.reconnect::parameters.body, - "json", +@@encodedName(BackendContracts.reconnect::parameters.body, + "application/json", "parameters" ); @@extension(BackendContracts.reconnect::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp index 209e2fe1b..cd2c5b484 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp @@ -141,8 +141,8 @@ interface CacheContracts { >; } -@@projectedName(CacheContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(CacheContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(CacheContracts.createOrUpdate::parameters.resource, @@ -152,8 +152,8 @@ interface CacheContracts { @@doc(CacheContracts.createOrUpdate::parameters.resource, "Create or Update parameters." ); -@@projectedName(CacheContracts.update::parameters.properties, - "json", +@@encodedName(CacheContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(CacheContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp index 4944ab4a5..c9282fe49 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp @@ -149,8 +149,8 @@ interface CertificateContracts { >; } -@@projectedName(CertificateContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(CertificateContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(CertificateContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp index c3ac673e1..802796788 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp @@ -150,8 +150,8 @@ interface DiagnosticContracts { >; } -@@projectedName(DiagnosticContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(DiagnosticContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(DiagnosticContracts.createOrUpdate::parameters.resource, @@ -161,8 +161,8 @@ interface DiagnosticContracts { @@doc(DiagnosticContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(DiagnosticContracts.update::parameters.properties, - "json", +@@encodedName(DiagnosticContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(DiagnosticContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp index 72c7b8cbb..29dbd9b45 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp @@ -149,8 +149,8 @@ interface EmailTemplateContracts { >; } -@@projectedName(EmailTemplateContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(EmailTemplateContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(EmailTemplateContracts.createOrUpdate::parameters.resource, @@ -160,8 +160,8 @@ interface EmailTemplateContracts { @@doc(EmailTemplateContracts.createOrUpdate::parameters.resource, "Email Template update parameters." ); -@@projectedName(EmailTemplateContracts.update::parameters.properties, - "json", +@@encodedName(EmailTemplateContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(EmailTemplateContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp index 2e075622d..356e09e5c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp @@ -132,8 +132,8 @@ interface GatewayCertificateAuthorityContracts { >; } -@@projectedName(GatewayCertificateAuthorityContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(GatewayCertificateAuthorityContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(GatewayCertificateAuthorityContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp index c8463e095..9e5dab370 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp @@ -238,8 +238,8 @@ interface GatewayContracts { >; } -@@projectedName(GatewayContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(GatewayContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(GatewayContracts.createOrUpdate::parameters.resource, @@ -247,8 +247,8 @@ interface GatewayContracts { "parameters" ); @@doc(GatewayContracts.createOrUpdate::parameters.resource, ""); -@@projectedName(GatewayContracts.update::parameters.properties, - "json", +@@encodedName(GatewayContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(GatewayContracts.update::parameters.properties, @@ -256,8 +256,8 @@ interface GatewayContracts { "parameters" ); @@doc(GatewayContracts.update::parameters.properties, ""); -@@projectedName(GatewayContracts.regenerateKey::parameters.body, - "json", +@@encodedName(GatewayContracts.regenerateKey::parameters.body, + "application/json", "parameters" ); @@extension(GatewayContracts.regenerateKey::parameters.body, @@ -265,8 +265,8 @@ interface GatewayContracts { "parameters" ); @@doc(GatewayContracts.regenerateKey::parameters.body, ""); -@@projectedName(GatewayContracts.generateToken::parameters.body, - "json", +@@encodedName(GatewayContracts.generateToken::parameters.body, + "application/json", "parameters" ); @@extension(GatewayContracts.generateToken::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp index b863d06c9..daa553bf4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp @@ -131,8 +131,8 @@ interface GatewayHostnameConfigurationContracts { >; } -@@projectedName(GatewayHostnameConfigurationContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(GatewayHostnameConfigurationContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(GatewayHostnameConfigurationContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp index 74c467c31..d137fc79e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp @@ -131,8 +131,8 @@ interface GlobalSchemaContracts { >; } -@@projectedName(GlobalSchemaContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(GlobalSchemaContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(GlobalSchemaContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp index 978d40a81..ece9f4108 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp @@ -207,8 +207,8 @@ interface GroupContracts { >; } -@@projectedName(GroupContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(GroupContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(GroupContracts.createOrUpdate::parameters.resource, @@ -216,8 +216,8 @@ interface GroupContracts { "parameters" ); @@doc(GroupContracts.createOrUpdate::parameters.resource, "Create parameters."); -@@projectedName(GroupContracts.update::parameters.properties, - "json", +@@encodedName(GroupContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(GroupContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp index 77027dc80..66002fcd6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp @@ -136,8 +136,8 @@ interface IdentityProviderContracts { >; } -@@projectedName(IdentityProviderContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(IdentityProviderContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(IdentityProviderContracts.createOrUpdate::parameters.resource, @@ -147,8 +147,8 @@ interface IdentityProviderContracts { @@doc(IdentityProviderContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(IdentityProviderContracts.update::parameters.properties, - "json", +@@encodedName(IdentityProviderContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(IdentityProviderContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp index 6522ff4ec..3f6561609 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp @@ -132,8 +132,8 @@ interface IssueAttachmentContracts { >; } -@@projectedName(IssueAttachmentContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(IssueAttachmentContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(IssueAttachmentContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp index 5e4190122..b25aa4a46 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp @@ -132,8 +132,8 @@ interface IssueCommentContracts { >; } -@@projectedName(IssueCommentContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(IssueCommentContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(IssueCommentContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp index f0cef8a4a..9c7d6dc99 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp @@ -164,8 +164,8 @@ interface IssueContracts { >; } -@@projectedName(IssueContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(IssueContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(IssueContracts.createOrUpdate::parameters.resource, @@ -173,8 +173,8 @@ interface IssueContracts { "parameters" ); @@doc(IssueContracts.createOrUpdate::parameters.resource, "Create parameters."); -@@projectedName(IssueContracts.update::parameters.properties, - "json", +@@encodedName(IssueContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(IssueContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp index f8e643f9b..0f541ca7a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp @@ -149,8 +149,8 @@ interface LoggerContracts { >; } -@@projectedName(LoggerContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(LoggerContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(LoggerContracts.createOrUpdate::parameters.resource, @@ -160,8 +160,8 @@ interface LoggerContracts { @@doc(LoggerContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(LoggerContracts.update::parameters.properties, - "json", +@@encodedName(LoggerContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(LoggerContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp index 9747cc628..332cd1c72 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp @@ -177,8 +177,8 @@ interface NamedValueContracts { >; } -@@projectedName(NamedValueContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(NamedValueContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(NamedValueContracts.createOrUpdate::parameters.resource, @@ -188,8 +188,8 @@ interface NamedValueContracts { @@doc(NamedValueContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(NamedValueContracts.update::parameters.properties, - "json", +@@encodedName(NamedValueContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(NamedValueContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp index 925f366d0..404011643 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp @@ -197,8 +197,8 @@ interface OpenidConnectProviderContracts { >; } -@@projectedName(OpenidConnectProviderContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(OpenidConnectProviderContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(OpenidConnectProviderContracts.createOrUpdate::parameters.resource, @@ -208,8 +208,8 @@ interface OpenidConnectProviderContracts { @@doc(OpenidConnectProviderContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(OpenidConnectProviderContracts.update::parameters.properties, - "json", +@@encodedName(OpenidConnectProviderContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(OpenidConnectProviderContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp index cf7df9512..b02b046b4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp @@ -155,8 +155,8 @@ interface OperationContracts { >; } -@@projectedName(OperationContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(OperationContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(OperationContracts.createOrUpdate::parameters.resource, @@ -166,8 +166,8 @@ interface OperationContracts { @@doc(OperationContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(OperationContracts.update::parameters.properties, - "json", +@@encodedName(OperationContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(OperationContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp index 84ee24767..67bcb01ed 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp @@ -114,8 +114,8 @@ interface PolicyContracts { listByOperation is ArmResourceListByParent; } -@@projectedName(PolicyContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(PolicyContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(PolicyContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp index 81908a6ec..64a99eaa1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp @@ -37,7 +37,6 @@ model PortalDelegationSettings extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "PortalDelegationSettings") interface PortalDelegationSettingsOperationGroup { /** * Get Delegation Settings for the Portal. @@ -116,8 +115,8 @@ interface PortalDelegationSettingsOperationGroup { >; } -@@projectedName(PortalDelegationSettingsOperationGroup.createOrUpdate::parameters.resource, - "json", +@@encodedName(PortalDelegationSettingsOperationGroup.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(PortalDelegationSettingsOperationGroup.createOrUpdate::parameters.resource, @@ -127,8 +126,8 @@ interface PortalDelegationSettingsOperationGroup { @@doc(PortalDelegationSettingsOperationGroup.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(PortalDelegationSettingsOperationGroup.update::parameters.properties, - "json", +@@encodedName(PortalDelegationSettingsOperationGroup.update::parameters.properties, + "application/json", "parameters" ); @@extension(PortalDelegationSettingsOperationGroup.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp index 152e5f39f..3744027da 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp @@ -128,8 +128,8 @@ interface PortalRevisionContracts { >; } -@@projectedName(PortalRevisionContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(PortalRevisionContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(PortalRevisionContracts.createOrUpdate::parameters.resource, @@ -137,8 +137,8 @@ interface PortalRevisionContracts { "parameters" ); @@doc(PortalRevisionContracts.createOrUpdate::parameters.resource, ""); -@@projectedName(PortalRevisionContracts.update::parameters.properties, - "json", +@@encodedName(PortalRevisionContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(PortalRevisionContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp index f132fd68a..00bd38e82 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp @@ -37,7 +37,6 @@ model PortalSigninSettings extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "PortalSigninSettings") interface PortalSigninSettingsOperationGroup { /** * Get Sign In Settings for the Portal @@ -105,8 +104,8 @@ interface PortalSigninSettingsOperationGroup { listByService is ArmResourceListByParent; } -@@projectedName(PortalSigninSettingsOperationGroup.createOrUpdate::parameters.resource, - "json", +@@encodedName(PortalSigninSettingsOperationGroup.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(PortalSigninSettingsOperationGroup.createOrUpdate::parameters.resource, @@ -116,8 +115,8 @@ interface PortalSigninSettingsOperationGroup { @@doc(PortalSigninSettingsOperationGroup.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(PortalSigninSettingsOperationGroup.update::parameters.properties, - "json", +@@encodedName(PortalSigninSettingsOperationGroup.update::parameters.properties, + "application/json", "parameters" ); @@extension(PortalSigninSettingsOperationGroup.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp index c4b183174..fda6c5b5d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp @@ -37,7 +37,6 @@ model PortalSignupSettings extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "PortalSignupSettings") interface PortalSignupSettingsOperationGroup { /** * Get Sign Up Settings for the Portal @@ -105,8 +104,8 @@ interface PortalSignupSettingsOperationGroup { listByService is ArmResourceListByParent; } -@@projectedName(PortalSignupSettingsOperationGroup.createOrUpdate::parameters.resource, - "json", +@@encodedName(PortalSignupSettingsOperationGroup.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(PortalSignupSettingsOperationGroup.createOrUpdate::parameters.resource, @@ -116,8 +115,8 @@ interface PortalSignupSettingsOperationGroup { @@doc(PortalSignupSettingsOperationGroup.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(PortalSignupSettingsOperationGroup.update::parameters.properties, - "json", +@@encodedName(PortalSignupSettingsOperationGroup.update::parameters.properties, + "application/json", "parameters" ); @@extension(PortalSignupSettingsOperationGroup.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp index 8667fc2e4..f8c0de653 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp @@ -70,8 +70,8 @@ interface PrivateEndpointConnections { listByService is ArmResourceListByParent; } -@@projectedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, - "json", +@@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, + "application/json", "privateEndpointConnectionRequest" ); @@extension(PrivateEndpointConnections.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp index f594361e4..30e2357e8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp @@ -350,8 +350,8 @@ interface ProductContracts { >; } -@@projectedName(ProductContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(ProductContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ProductContracts.createOrUpdate::parameters.resource, @@ -361,8 +361,8 @@ interface ProductContracts { @@doc(ProductContracts.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(ProductContracts.update::parameters.properties, - "json", +@@encodedName(ProductContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(ProductContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp index 3b6b37244..23c934ad6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp @@ -135,8 +135,8 @@ interface SchemaContracts { >; } -@@projectedName(SchemaContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(SchemaContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(SchemaContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp index d8a6466ac..aa7771a58 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp @@ -208,8 +208,8 @@ interface SubscriptionContracts { >; } -@@projectedName(SubscriptionContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(SubscriptionContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(SubscriptionContracts.createOrUpdate::parameters.resource, @@ -219,8 +219,8 @@ interface SubscriptionContracts { @@doc(SubscriptionContracts.createOrUpdate::parameters.resource, "Create parameters." ); -@@projectedName(SubscriptionContracts.update::parameters.properties, - "json", +@@encodedName(SubscriptionContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(SubscriptionContracts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp index a2bd6ed73..d2a398319 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp @@ -132,8 +132,8 @@ interface TagDescriptionContracts { >; } -@@projectedName(TagDescriptionContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(TagDescriptionContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(TagDescriptionContracts.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp index eb4f0bfdd..9a178440e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp @@ -320,8 +320,8 @@ interface UserContracts { >; } -@@projectedName(UserContracts.createOrUpdate::parameters.resource, - "json", +@@encodedName(UserContracts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(UserContracts.createOrUpdate::parameters.resource, @@ -331,8 +331,8 @@ interface UserContracts { @@doc(UserContracts.createOrUpdate::parameters.resource, "Create or update parameters." ); -@@projectedName(UserContracts.update::parameters.properties, - "json", +@@encodedName(UserContracts.update::parameters.properties, + "application/json", "parameters" ); @@extension(UserContracts.update::parameters.properties, @@ -340,8 +340,8 @@ interface UserContracts { "parameters" ); @@doc(UserContracts.update::parameters.properties, "Update parameters."); -@@projectedName(UserContracts.getSharedAccessToken::parameters.body, - "json", +@@encodedName(UserContracts.getSharedAccessToken::parameters.body, + "application/json", "parameters" ); @@extension(UserContracts.getSharedAccessToken::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp index 74d62021b..a6533b63d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp @@ -141,3 +141,11 @@ using Azure.ResourceManager.ApiManagement; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(QuotaCounterValueContract.value); + +@@clientName(PortalSigninSettingsOperationGroup, "PortalSigninSettings"); + +@@clientName(PortalSignupSettingsOperationGroup, "PortalSignupSettings"); + +@@clientName(PortalDelegationSettingsOperationGroup, + "PortalDelegationSettings" +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp index a5914ea52..7d93036c3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp @@ -1087,7 +1087,7 @@ model ApiEntityBaseContract { /** * Type of API. */ - @projectedName("json", "type") + @encodedName("application/json", "type") apiType?: ApiType; /** @@ -1134,7 +1134,7 @@ model ApiEntityBaseContract { /** * Specifies whether an API or Product subscription is required for accessing the API. */ - @projectedName("json", "subscriptionRequired") + @encodedName("application/json", "subscriptionRequired") IsSubscriptionRequired?: boolean; /** @@ -1347,7 +1347,7 @@ model ApiCreateOrUpdateProperties extends ApiContractProperties { * * `websocket` creates websocket API * * `graphql` creates GraphQL API. */ - @projectedName("json", "apiType") + @encodedName("application/json", "apiType") soapApiType?: SoapApiType; } @@ -1804,13 +1804,13 @@ model ProductEntityBaseParameters { /** * Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. */ - @projectedName("json", "subscriptionRequired") + @encodedName("application/json", "subscriptionRequired") IsSubscriptionRequired?: boolean; /** * whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. */ - @projectedName("json", "approvalRequired") + @encodedName("application/json", "approvalRequired") IsApprovalRequired?: boolean; /** @@ -2330,7 +2330,7 @@ model ApiExportResult { /** * Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. */ - @projectedName("json", "format") + @encodedName("application/json", "format") exportResultFormat?: ExportResultFormat; /** @@ -2472,7 +2472,7 @@ model AuthorizationServerContractBaseProperties { /** * Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. */ - @projectedName("json", "clientAuthenticationMethod") + @encodedName("application/json", "clientAuthenticationMethod") clientAuthenticationMethods?: ClientAuthenticationMethod[]; /** @@ -2488,7 +2488,7 @@ model AuthorizationServerContractBaseProperties { /** * If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. */ - @projectedName("json", "supportState") + @encodedName("application/json", "supportState") doesSupportState?: boolean; /** @@ -2877,7 +2877,7 @@ model CacheContractProperties { * Original uri of entity in external system cache points to */ @maxLength(2000) - @projectedName("json", "resourceId") + @encodedName("application/json", "resourceId") resourceUri?: string; } @@ -2917,7 +2917,7 @@ model CacheUpdateProperties { * Original uri of entity in external system cache points to */ @maxLength(2000) - @projectedName("json", "resourceId") + @encodedName("application/json", "resourceId") resourceUri?: string; } @@ -3092,7 +3092,7 @@ model ConnectivityCheckRequestProtocolConfiguration { /** * Configuration for HTTP or HTTPS requests. */ - @projectedName("json", "HTTPConfiguration") + @encodedName("application/json", "HTTPConfiguration") httpConfiguration?: ConnectivityCheckRequestProtocolConfigurationHttpConfiguration; } @@ -4556,13 +4556,13 @@ model IdentityProviderBaseParameters { /** * Identity Provider Type identifier. */ - @projectedName("json", "type") + @encodedName("application/json", "type") identityProviderType?: IdentityProviderType; /** * The TenantId to use instead of Common when logging into Active Directory */ - @projectedName("json", "signinTenant") + @encodedName("application/json", "signinTenant") signInTenant?: string; /** @@ -4579,14 +4579,14 @@ model IdentityProviderBaseParameters { * Signup Policy Name. Only applies to AAD B2C Identity Provider. */ @minLength(1) - @projectedName("json", "signupPolicyName") + @encodedName("application/json", "signupPolicyName") signUpPolicyName?: string; /** * Signin Policy Name. Only applies to AAD B2C Identity Provider. */ @minLength(1) - @projectedName("json", "signinPolicyName") + @encodedName("application/json", "signinPolicyName") signInPolicyName?: string; /** @@ -4770,7 +4770,7 @@ model NamedValueEntityBaseParameters { /** * Determines whether the value is a secret and should be encrypted or not. Default value is false. */ - @projectedName("json", "secret") + @encodedName("application/json", "secret") IsSecret?: boolean; } @@ -5294,13 +5294,13 @@ model PortalSettingsContractProperties { /** * Subscriptions delegation settings. */ - @projectedName("json", "subscriptions") + @encodedName("application/json", "subscriptions") IsSubscriptions?: SubscriptionsDelegationSettingsProperties; /** * User registration delegation settings. */ - @projectedName("json", "userRegistration") + @encodedName("application/json", "userRegistration") IsUserRegistration?: RegistrationDelegationSettingsProperties; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/ProviderOperationsMetadata.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/ProviderOperationsMetadata.tsp index c934dddd6..074bbbcc8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/ProviderOperationsMetadata.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/ProviderOperationsMetadata.tsp @@ -43,7 +43,6 @@ model ProviderOperationsMetadata is ProxyResource<{}> { } @armResourceOperations -@projectedName("client", "ProviderOperationsMetadata") interface ProviderOperationsMetadataOperationGroup { /** * Gets provider operations metadata for the specified resource provider. diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp index b2a56efe3..82f8ff2a1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp @@ -105,8 +105,8 @@ interface RoleAssignments { >; } -@@projectedName(RoleAssignments.create::parameters.resource, - "json", +@@encodedName(RoleAssignments.create::parameters.resource, + "application/json", "parameters" ); @@extension(RoleAssignments.create::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp index f2fcfc404..9bbd5205d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp @@ -82,8 +82,8 @@ interface RoleAssignmentScheduleRequests { >; } -@@projectedName(RoleAssignmentScheduleRequests.create::parameters.resource, - "json", +@@encodedName(RoleAssignmentScheduleRequests.create::parameters.resource, + "application/json", "parameters" ); @@extension(RoleAssignmentScheduleRequests.create::parameters.resource, @@ -93,8 +93,8 @@ interface RoleAssignmentScheduleRequests { @@doc(RoleAssignmentScheduleRequests.create::parameters.resource, "Parameters for the role assignment schedule request." ); -@@projectedName(RoleAssignmentScheduleRequests.validate::parameters.body, - "json", +@@encodedName(RoleAssignmentScheduleRequests.validate::parameters.body, + "application/json", "parameters" ); @@extension(RoleAssignmentScheduleRequests.validate::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp index a49f81cf1..3f2bb6cc7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp @@ -71,8 +71,8 @@ interface RoleDefinitions { >; } -@@projectedName(RoleDefinitions.createOrUpdate::parameters.resource, - "json", +@@encodedName(RoleDefinitions.createOrUpdate::parameters.resource, + "application/json", "roleDefinition" ); @@extension(RoleDefinitions.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp index d86f42e27..d78d589b3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp @@ -82,8 +82,8 @@ interface RoleEligibilityScheduleRequests { >; } -@@projectedName(RoleEligibilityScheduleRequests.create::parameters.resource, - "json", +@@encodedName(RoleEligibilityScheduleRequests.create::parameters.resource, + "application/json", "parameters" ); @@extension(RoleEligibilityScheduleRequests.create::parameters.resource, @@ -93,8 +93,8 @@ interface RoleEligibilityScheduleRequests { @@doc(RoleEligibilityScheduleRequests.create::parameters.resource, "Parameters for the role eligibility schedule request." ); -@@projectedName(RoleEligibilityScheduleRequests.validate::parameters.body, - "json", +@@encodedName(RoleEligibilityScheduleRequests.validate::parameters.body, + "application/json", "parameters" ); @@extension(RoleEligibilityScheduleRequests.validate::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp index 68231176a..f8ca09ee6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp @@ -58,8 +58,8 @@ interface RoleManagementPolicies { listForScope is ArmResourceListByParent; } -@@projectedName(RoleManagementPolicies.update::parameters.properties, - "json", +@@encodedName(RoleManagementPolicies.update::parameters.properties, + "application/json", "parameters" ); @@extension(RoleManagementPolicies.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp index f2eba157c..dd923a570 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp @@ -57,8 +57,8 @@ interface RoleManagementPolicyAssignments { listForScope is ArmResourceListByParent; } -@@projectedName(RoleManagementPolicyAssignments.create::parameters.resource, - "json", +@@encodedName(RoleManagementPolicyAssignments.create::parameters.resource, + "application/json", "parameters" ); @@extension(RoleManagementPolicyAssignments.create::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp index c438185ba..490902b96 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp @@ -43,3 +43,7 @@ using Azure.ResourceManager.Authorization; @@flattenProperty(PolicyAssignmentProperties.roleDefinition); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(PolicyAssignmentProperties.policy); + +@@clientName(ProviderOperationsMetadataOperationGroup, + "ProviderOperationsMetadata" +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp index 146d31633..637adb5ea 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp @@ -322,7 +322,7 @@ model Principal { /** * Type of the principal. */ - @projectedName("json", "type") + @encodedName("application/json", "type") principalType?: PrincipalType; /** @@ -513,7 +513,7 @@ model RoleDefinitionProperties { /** * The role type. */ - @projectedName("json", "type") + @encodedName("application/json", "type") roleType?: RoleType; /** @@ -693,19 +693,19 @@ model ExpandedPropertiesScope { /** * Scope id of the resource */ - @projectedName("json", "id") + @encodedName("application/json", "id") scopeId?: string; /** * Display name of the resource */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") scopeDisplayName?: string; /** * Type of the scope. */ - @projectedName("json", "type") + @encodedName("application/json", "type") scopeType?: ScopeType; } @@ -716,19 +716,19 @@ model ExpandedPropertiesRoleDefinition { /** * Id of the role definition */ - @projectedName("json", "id") + @encodedName("application/json", "id") roleDefinitionId?: string; /** * Display name of the role definition */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") roleDefinitionDisplayName?: string; /** * The role type. */ - @projectedName("json", "type") + @encodedName("application/json", "type") roleType?: RoleType; } @@ -739,13 +739,13 @@ model ExpandedPropertiesPrincipal { /** * Id of the principal */ - @projectedName("json", "id") + @encodedName("application/json", "id") principalId?: string; /** * Display name of the principal */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") principalDisplayName?: string; /** @@ -756,7 +756,7 @@ model ExpandedPropertiesPrincipal { /** * Type of the principal. */ - @projectedName("json", "type") + @encodedName("application/json", "type") principalType?: PrincipalType; } @@ -975,7 +975,7 @@ model RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { /** * Type of the role assignment schedule expiration */ - @projectedName("json", "type") + @encodedName("application/json", "type") expirationType?: RoleManagementScheduleExpirationType; /** @@ -1272,7 +1272,7 @@ model RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { /** * Type of the role eligibility schedule expiration */ - @projectedName("json", "type") + @encodedName("application/json", "type") expirationType?: RoleManagementScheduleExpirationType; /** @@ -1426,19 +1426,19 @@ model PolicyPropertiesScope { /** * Scope id of the resource */ - @projectedName("json", "id") + @encodedName("application/json", "id") scopeId?: string; /** * Display name of the resource */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") scopeDisplayName?: string; /** * Type of the scope. */ - @projectedName("json", "type") + @encodedName("application/json", "type") scopeType?: ScopeType; } @@ -1501,19 +1501,19 @@ model PolicyAssignmentPropertiesScope { /** * Scope id of the resource */ - @projectedName("json", "id") + @encodedName("application/json", "id") scopeId?: string; /** * Display name of the resource */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") scopeDisplayName?: string; /** * Type of the scope. */ - @projectedName("json", "type") + @encodedName("application/json", "type") scopeType?: ScopeType; } @@ -1524,19 +1524,19 @@ model PolicyAssignmentPropertiesRoleDefinition { /** * Id of the role definition */ - @projectedName("json", "id") + @encodedName("application/json", "id") roleDefinitionId?: string; /** * Display name of the role definition */ - @projectedName("json", "displayName") + @encodedName("application/json", "displayName") roleDefinitionDisplayName?: string; /** * The role type. */ - @projectedName("json", "type") + @encodedName("application/json", "type") roleType?: RoleType; } @@ -1547,7 +1547,7 @@ model PolicyAssignmentPropertiesPolicy { /** * Id of the policy */ - @projectedName("json", "id") + @encodedName("application/json", "id") policyId?: string; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp index 6988e8f80..10b2cacb7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp @@ -412,7 +412,7 @@ model TrackingProfileDefinition { /** * The tracking definition schema uri. */ - @projectedName("json", "$schema") + @encodedName("application/json", "$schema") schema?: string; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp index 851302b83..9ef72db39 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp @@ -104,8 +104,8 @@ interface AvailabilitySets { >; } -@@projectedName(AvailabilitySets.createOrUpdate::parameters.resource, - "json", +@@encodedName(AvailabilitySets.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(AvailabilitySets.createOrUpdate::parameters.resource, @@ -115,8 +115,8 @@ interface AvailabilitySets { @@doc(AvailabilitySets.createOrUpdate::parameters.resource, "Parameters supplied to the Create Availability Set operation." ); -@@projectedName(AvailabilitySets.update::parameters.properties, - "json", +@@encodedName(AvailabilitySets.update::parameters.properties, + "application/json", "parameters" ); @@extension(AvailabilitySets.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp index 857a23382..3f41f7eaa 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp @@ -88,8 +88,8 @@ interface CapacityReservations { listByCapacityReservationGroup is ArmResourceListByParent; } -@@projectedName(CapacityReservations.createOrUpdate::parameters.resource, - "json", +@@encodedName(CapacityReservations.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(CapacityReservations.createOrUpdate::parameters.resource, @@ -99,8 +99,8 @@ interface CapacityReservations { @@doc(CapacityReservations.createOrUpdate::parameters.resource, "Parameters supplied to the Create capacity reservation." ); -@@projectedName(CapacityReservations.update::parameters.properties, - "json", +@@encodedName(CapacityReservations.update::parameters.properties, + "application/json", "parameters" ); @@extension(CapacityReservations.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp index 25169263c..c8cd9aeb7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp @@ -100,8 +100,8 @@ interface CapacityReservationGroups { listBySubscription is ArmListBySubscription; } -@@projectedName(CapacityReservationGroups.createOrUpdate::parameters.resource, - "json", +@@encodedName(CapacityReservationGroups.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(CapacityReservationGroups.createOrUpdate::parameters.resource, @@ -111,8 +111,8 @@ interface CapacityReservationGroups { @@doc(CapacityReservationGroups.createOrUpdate::parameters.resource, "Parameters supplied to the Create capacity reservation Group." ); -@@projectedName(CapacityReservationGroups.update::parameters.properties, - "json", +@@encodedName(CapacityReservationGroups.update::parameters.properties, + "application/json", "parameters" ); @@extension(CapacityReservationGroups.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp index 5943f746c..cf589cff8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp @@ -230,8 +230,8 @@ interface CloudServices { >; } -@@projectedName(CloudServices.createOrUpdate::parameters.resource, - "json", +@@encodedName(CloudServices.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(CloudServices.createOrUpdate::parameters.resource, @@ -241,8 +241,8 @@ interface CloudServices { @@doc(CloudServices.createOrUpdate::parameters.resource, "The cloud service object." ); -@@projectedName(CloudServices.update::parameters.properties, - "json", +@@encodedName(CloudServices.update::parameters.properties, + "application/json", "parameters" ); @@extension(CloudServices.update::parameters.properties, @@ -250,7 +250,10 @@ interface CloudServices { "parameters" ); @@doc(CloudServices.update::parameters.properties, "The cloud service object."); -@@projectedName(CloudServices.restart::parameters.body, "json", "parameters"); +@@encodedName(CloudServices.restart::parameters.body, + "application/json", + "parameters" +); @@extension(CloudServices.restart::parameters.body, "x-ms-client-name", "parameters" @@ -258,7 +261,10 @@ interface CloudServices { @@doc(CloudServices.restart::parameters.body, "List of cloud service role instance names." ); -@@projectedName(CloudServices.reimage::parameters.body, "json", "parameters"); +@@encodedName(CloudServices.reimage::parameters.body, + "application/json", + "parameters" +); @@extension(CloudServices.reimage::parameters.body, "x-ms-client-name", "parameters" @@ -266,7 +272,10 @@ interface CloudServices { @@doc(CloudServices.reimage::parameters.body, "List of cloud service role instance names." ); -@@projectedName(CloudServices.rebuild::parameters.body, "json", "parameters"); +@@encodedName(CloudServices.rebuild::parameters.body, + "application/json", + "parameters" +); @@extension(CloudServices.rebuild::parameters.body, "x-ms-client-name", "parameters" @@ -274,8 +283,8 @@ interface CloudServices { @@doc(CloudServices.rebuild::parameters.body, "List of cloud service role instance names." ); -@@projectedName(CloudServices.deleteInstances::parameters.body, - "json", +@@encodedName(CloudServices.deleteInstances::parameters.body, + "application/json", "parameters" ); @@extension(CloudServices.deleteInstances::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp index bd8d7548d..753a85536 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp @@ -94,8 +94,8 @@ interface DedicatedHosts { listAvailableSizes is Azure.Core.ResourceList; } -@@projectedName(DedicatedHosts.createOrUpdate::parameters.resource, - "json", +@@encodedName(DedicatedHosts.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(DedicatedHosts.createOrUpdate::parameters.resource, @@ -105,8 +105,8 @@ interface DedicatedHosts { @@doc(DedicatedHosts.createOrUpdate::parameters.resource, "Parameters supplied to the Create Dedicated Host." ); -@@projectedName(DedicatedHosts.update::parameters.properties, - "json", +@@encodedName(DedicatedHosts.update::parameters.properties, + "application/json", "parameters" ); @@extension(DedicatedHosts.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp index c5d13636a..cdd970b42 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp @@ -86,8 +86,8 @@ interface DedicatedHostGroups { listBySubscription is ArmListBySubscription; } -@@projectedName(DedicatedHostGroups.createOrUpdate::parameters.resource, - "json", +@@encodedName(DedicatedHostGroups.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(DedicatedHostGroups.createOrUpdate::parameters.resource, @@ -97,8 +97,8 @@ interface DedicatedHostGroups { @@doc(DedicatedHostGroups.createOrUpdate::parameters.resource, "Parameters supplied to the Create Dedicated Host Group." ); -@@projectedName(DedicatedHostGroups.update::parameters.properties, - "json", +@@encodedName(DedicatedHostGroups.update::parameters.properties, + "application/json", "parameters" ); @@extension(DedicatedHostGroups.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp index ea7381353..229c5c2c2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp @@ -107,7 +107,10 @@ interface Disks { revokeAccess is ArmResourceActionAsync; } -@@projectedName(Disks.createOrUpdate::parameters.resource, "json", "disk"); +@@encodedName(Disks.createOrUpdate::parameters.resource, + "application/json", + "disk" +); @@extension(Disks.createOrUpdate::parameters.resource, "x-ms-client-name", "disk" @@ -115,12 +118,15 @@ interface Disks { @@doc(Disks.createOrUpdate::parameters.resource, "Disk object supplied in the body of the Put disk operation." ); -@@projectedName(Disks.update::parameters.properties, "json", "disk"); +@@encodedName(Disks.update::parameters.properties, "application/json", "disk"); @@extension(Disks.update::parameters.properties, "x-ms-client-name", "disk"); @@doc(Disks.update::parameters.properties, "Disk object supplied in the body of the Patch disk operation." ); -@@projectedName(Disks.grantAccess::parameters.body, "json", "grantAccessData"); +@@encodedName(Disks.grantAccess::parameters.body, + "application/json", + "grantAccessData" +); @@extension(Disks.grantAccess::parameters.body, "x-ms-client-name", "grantAccessData" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp index 0e0836d56..4f1cfe623 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp @@ -101,8 +101,8 @@ interface DiskAccesses { >; } -@@projectedName(DiskAccesses.createOrUpdate::parameters.resource, - "json", +@@encodedName(DiskAccesses.createOrUpdate::parameters.resource, + "application/json", "diskAccess" ); @@extension(DiskAccesses.createOrUpdate::parameters.resource, @@ -112,8 +112,8 @@ interface DiskAccesses { @@doc(DiskAccesses.createOrUpdate::parameters.resource, "disk access object supplied in the body of the Put disk access operation." ); -@@projectedName(DiskAccesses.update::parameters.properties, - "json", +@@encodedName(DiskAccesses.update::parameters.properties, + "application/json", "diskAccess" ); @@extension(DiskAccesses.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp index 2f6572abc..13e7412d7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp @@ -78,8 +78,8 @@ interface DiskEncryptionSets { listAssociatedResources is Azure.Core.ResourceList; } -@@projectedName(DiskEncryptionSets.createOrUpdate::parameters.resource, - "json", +@@encodedName(DiskEncryptionSets.createOrUpdate::parameters.resource, + "application/json", "diskEncryptionSet" ); @@extension(DiskEncryptionSets.createOrUpdate::parameters.resource, @@ -89,8 +89,8 @@ interface DiskEncryptionSets { @@doc(DiskEncryptionSets.createOrUpdate::parameters.resource, "disk encryption set object supplied in the body of the Put disk encryption set operation." ); -@@projectedName(DiskEncryptionSets.update::parameters.properties, - "json", +@@encodedName(DiskEncryptionSets.update::parameters.properties, + "application/json", "diskEncryptionSet" ); @@extension(DiskEncryptionSets.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp index 9a0872c0c..ac556b9f7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp @@ -115,8 +115,8 @@ interface DiskRestorePoints { >; } -@@projectedName(DiskRestorePoints.grantAccess::parameters.body, - "json", +@@encodedName(DiskRestorePoints.grantAccess::parameters.body, + "application/json", "grantAccessData" ); @@extension(DiskRestorePoints.grantAccess::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp index 29e958e03..2e465110f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp @@ -94,8 +94,8 @@ interface Galleries { update is ArmResourceActionAsync; } -@@projectedName(Galleries.createOrUpdate::parameters.resource, - "json", +@@encodedName(Galleries.createOrUpdate::parameters.resource, + "application/json", "gallery" ); @@extension(Galleries.createOrUpdate::parameters.resource, @@ -105,7 +105,10 @@ interface Galleries { @@doc(Galleries.createOrUpdate::parameters.resource, "Parameters supplied to the create or update Shared Image Gallery operation." ); -@@projectedName(Galleries.update::parameters.properties, "json", "gallery"); +@@encodedName(Galleries.update::parameters.properties, + "application/json", + "gallery" +); @@extension(Galleries.update::parameters.properties, "x-ms-client-name", "gallery" @@ -113,7 +116,10 @@ interface Galleries { @@doc(Galleries.update::parameters.properties, "Parameters supplied to the update Shared Image Gallery operation." ); -@@projectedName(Galleries.update::parameters.body, "json", "sharingUpdate"); +@@encodedName(Galleries.update::parameters.body, + "application/json", + "sharingUpdate" +); @@extension(Galleries.update::parameters.body, "x-ms-client-name", "sharingUpdate" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp index 96ad81277..53e9211d5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp @@ -67,8 +67,8 @@ interface GalleryApplications { listByGallery is ArmResourceListByParent; } -@@projectedName(GalleryApplications.createOrUpdate::parameters.resource, - "json", +@@encodedName(GalleryApplications.createOrUpdate::parameters.resource, + "application/json", "galleryApplication" ); @@extension(GalleryApplications.createOrUpdate::parameters.resource, @@ -78,8 +78,8 @@ interface GalleryApplications { @@doc(GalleryApplications.createOrUpdate::parameters.resource, "Parameters supplied to the create or update gallery Application operation." ); -@@projectedName(GalleryApplications.update::parameters.properties, - "json", +@@encodedName(GalleryApplications.update::parameters.properties, + "application/json", "galleryApplication" ); @@extension(GalleryApplications.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp index 9ff8ff172..8fa0b9ca6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp @@ -81,8 +81,8 @@ interface GalleryApplicationVersions { listByGalleryApplication is ArmResourceListByParent; } -@@projectedName(GalleryApplicationVersions.createOrUpdate::parameters.resource, - "json", +@@encodedName(GalleryApplicationVersions.createOrUpdate::parameters.resource, + "application/json", "galleryApplicationVersion" ); @@extension(GalleryApplicationVersions.createOrUpdate::parameters.resource, @@ -92,8 +92,8 @@ interface GalleryApplicationVersions { @@doc(GalleryApplicationVersions.createOrUpdate::parameters.resource, "Parameters supplied to the create or update gallery Application Version operation." ); -@@projectedName(GalleryApplicationVersions.update::parameters.properties, - "json", +@@encodedName(GalleryApplicationVersions.update::parameters.properties, + "application/json", "galleryApplicationVersion" ); @@extension(GalleryApplicationVersions.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp index b2c497576..874ed3c1e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp @@ -67,8 +67,8 @@ interface GalleryImages { listByGallery is ArmResourceListByParent; } -@@projectedName(GalleryImages.createOrUpdate::parameters.resource, - "json", +@@encodedName(GalleryImages.createOrUpdate::parameters.resource, + "application/json", "galleryImage" ); @@extension(GalleryImages.createOrUpdate::parameters.resource, @@ -78,8 +78,8 @@ interface GalleryImages { @@doc(GalleryImages.createOrUpdate::parameters.resource, "Parameters supplied to the create or update gallery image operation." ); -@@projectedName(GalleryImages.update::parameters.properties, - "json", +@@encodedName(GalleryImages.update::parameters.properties, + "application/json", "galleryImage" ); @@extension(GalleryImages.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp index d7522f0a5..aff2656ca 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp @@ -78,8 +78,8 @@ interface GalleryImageVersions { listByGalleryImage is ArmResourceListByParent; } -@@projectedName(GalleryImageVersions.createOrUpdate::parameters.resource, - "json", +@@encodedName(GalleryImageVersions.createOrUpdate::parameters.resource, + "application/json", "galleryImageVersion" ); @@extension(GalleryImageVersions.createOrUpdate::parameters.resource, @@ -89,8 +89,8 @@ interface GalleryImageVersions { @@doc(GalleryImageVersions.createOrUpdate::parameters.resource, "Parameters supplied to the create or update gallery image version operation." ); -@@projectedName(GalleryImageVersions.update::parameters.properties, - "json", +@@encodedName(GalleryImageVersions.update::parameters.properties, + "application/json", "galleryImageVersion" ); @@extension(GalleryImageVersions.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp index a4cdd37c3..d26977a28 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp @@ -86,8 +86,8 @@ interface Images { list is ArmListBySubscription; } -@@projectedName(Images.createOrUpdate::parameters.resource, - "json", +@@encodedName(Images.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(Images.createOrUpdate::parameters.resource, @@ -97,7 +97,10 @@ interface Images { @@doc(Images.createOrUpdate::parameters.resource, "Parameters supplied to the Create Image operation." ); -@@projectedName(Images.update::parameters.properties, "json", "parameters"); +@@encodedName(Images.update::parameters.properties, + "application/json", + "parameters" +); @@extension(Images.update::parameters.properties, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp index 8520dce44..cfd4dc89d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp @@ -79,8 +79,8 @@ interface PrivateEndpointConnections { listPrivateEndpointConnections is ArmResourceListByParent; } -@@projectedName(PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource, - "json", +@@encodedName(PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource, + "application/json", "privateEndpointConnection" ); @@extension(PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp index 3020d274e..2d9450473 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp @@ -89,8 +89,8 @@ interface ProximityPlacementGroups { listBySubscription is ArmListBySubscription; } -@@projectedName(ProximityPlacementGroups.createOrUpdate::parameters.resource, - "json", +@@encodedName(ProximityPlacementGroups.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(ProximityPlacementGroups.createOrUpdate::parameters.resource, @@ -100,8 +100,8 @@ interface ProximityPlacementGroups { @@doc(ProximityPlacementGroups.createOrUpdate::parameters.resource, "Parameters supplied to the Create Proximity Placement Group operation." ); -@@projectedName(ProximityPlacementGroups.update::parameters.properties, - "json", +@@encodedName(ProximityPlacementGroups.update::parameters.properties, + "application/json", "parameters" ); @@extension(ProximityPlacementGroups.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp index a00ed5621..9af5bc6a3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp @@ -93,8 +93,8 @@ interface RestorePoints { >; } -@@projectedName(RestorePoints.create::parameters.resource, - "json", +@@encodedName(RestorePoints.create::parameters.resource, + "application/json", "parameters" ); @@extension(RestorePoints.create::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp index af42336a1..5b37ad082 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp @@ -121,8 +121,8 @@ interface RestorePointCollections { listAll is ArmListBySubscription; } -@@projectedName(RestorePointCollections.createOrUpdate::parameters.resource, - "json", +@@encodedName(RestorePointCollections.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(RestorePointCollections.createOrUpdate::parameters.resource, @@ -132,8 +132,8 @@ interface RestorePointCollections { @@doc(RestorePointCollections.createOrUpdate::parameters.resource, "Parameters supplied to the Create or Update restore point collection operation." ); -@@projectedName(RestorePointCollections.update::parameters.properties, - "json", +@@encodedName(RestorePointCollections.update::parameters.properties, + "application/json", "parameters" ); @@extension(RestorePointCollections.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp index 4d2f7c9f7..f6ff9d07c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp @@ -96,8 +96,8 @@ interface Snapshots { revokeAccess is ArmResourceActionAsync; } -@@projectedName(Snapshots.createOrUpdate::parameters.resource, - "json", +@@encodedName(Snapshots.createOrUpdate::parameters.resource, + "application/json", "snapshot" ); @@extension(Snapshots.createOrUpdate::parameters.resource, @@ -107,7 +107,10 @@ interface Snapshots { @@doc(Snapshots.createOrUpdate::parameters.resource, "Snapshot object supplied in the body of the Put disk operation." ); -@@projectedName(Snapshots.update::parameters.properties, "json", "snapshot"); +@@encodedName(Snapshots.update::parameters.properties, + "application/json", + "snapshot" +); @@extension(Snapshots.update::parameters.properties, "x-ms-client-name", "snapshot" @@ -115,8 +118,8 @@ interface Snapshots { @@doc(Snapshots.update::parameters.properties, "Snapshot object supplied in the body of the Patch snapshot operation." ); -@@projectedName(Snapshots.grantAccess::parameters.body, - "json", +@@encodedName(Snapshots.grantAccess::parameters.body, + "application/json", "grantAccessData" ); @@extension(Snapshots.grantAccess::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp index 17d75b321..5f08ec350 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp @@ -94,8 +94,8 @@ interface SshPublicKeyResources { >; } -@@projectedName(SshPublicKeyResources.create::parameters.resource, - "json", +@@encodedName(SshPublicKeyResources.create::parameters.resource, + "application/json", "parameters" ); @@extension(SshPublicKeyResources.create::parameters.resource, @@ -105,8 +105,8 @@ interface SshPublicKeyResources { @@doc(SshPublicKeyResources.create::parameters.resource, "Parameters supplied to create the SSH public key." ); -@@projectedName(SshPublicKeyResources.update::parameters.properties, - "json", +@@encodedName(SshPublicKeyResources.update::parameters.properties, + "application/json", "parameters" ); @@extension(SshPublicKeyResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp index 87ce75fa0..5093fe6e0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp @@ -350,8 +350,8 @@ interface VirtualMachines { >; } -@@projectedName(VirtualMachines.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachines.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(VirtualMachines.createOrUpdate::parameters.resource, @@ -361,8 +361,8 @@ interface VirtualMachines { @@doc(VirtualMachines.createOrUpdate::parameters.resource, "Parameters supplied to the Create Virtual Machine operation." ); -@@projectedName(VirtualMachines.update::parameters.properties, - "json", +@@encodedName(VirtualMachines.update::parameters.properties, + "application/json", "parameters" ); @@extension(VirtualMachines.update::parameters.properties, @@ -372,7 +372,10 @@ interface VirtualMachines { @@doc(VirtualMachines.update::parameters.properties, "Parameters supplied to the Update Virtual Machine operation." ); -@@projectedName(VirtualMachines.capture::parameters.body, "json", "parameters"); +@@encodedName(VirtualMachines.capture::parameters.body, + "application/json", + "parameters" +); @@extension(VirtualMachines.capture::parameters.body, "x-ms-client-name", "parameters" @@ -380,7 +383,10 @@ interface VirtualMachines { @@doc(VirtualMachines.capture::parameters.body, "Parameters supplied to the Capture Virtual Machine operation." ); -@@projectedName(VirtualMachines.reimage::parameters.body, "json", "parameters"); +@@encodedName(VirtualMachines.reimage::parameters.body, + "application/json", + "parameters" +); @@extension(VirtualMachines.reimage::parameters.body, "x-ms-client-name", "parameters" @@ -388,8 +394,8 @@ interface VirtualMachines { @@doc(VirtualMachines.reimage::parameters.body, "Parameters supplied to the Reimage Virtual Machine operation." ); -@@projectedName(VirtualMachines.installPatches::parameters.body, - "json", +@@encodedName(VirtualMachines.installPatches::parameters.body, + "application/json", "installPatchesInput" ); @@extension(VirtualMachines.installPatches::parameters.body, @@ -399,8 +405,8 @@ interface VirtualMachines { @@doc(VirtualMachines.installPatches::parameters.body, "Input for InstallPatches as directly received by the API" ); -@@projectedName(VirtualMachines.runCommand::parameters.body, - "json", +@@encodedName(VirtualMachines.runCommand::parameters.body, + "application/json", "parameters" ); @@extension(VirtualMachines.runCommand::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp index acb27a340..b7563ad16 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp @@ -92,8 +92,8 @@ interface VirtualMachineExtensions { >; } -@@projectedName(VirtualMachineExtensions.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachineExtensions.createOrUpdate::parameters.resource, + "application/json", "extensionParameters" ); @@extension(VirtualMachineExtensions.createOrUpdate::parameters.resource, @@ -103,8 +103,8 @@ interface VirtualMachineExtensions { @@doc(VirtualMachineExtensions.createOrUpdate::parameters.resource, "Parameters supplied to the Create Virtual Machine Extension operation." ); -@@projectedName(VirtualMachineExtensions.update::parameters.properties, - "json", +@@encodedName(VirtualMachineExtensions.update::parameters.properties, + "application/json", "extensionParameters" ); @@extension(VirtualMachineExtensions.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp index 5281bd700..6118c862e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp @@ -110,8 +110,8 @@ interface VirtualMachineRunCommands { >; } -@@projectedName(VirtualMachineRunCommands.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachineRunCommands.createOrUpdate::parameters.resource, + "application/json", "runCommand" ); @@extension(VirtualMachineRunCommands.createOrUpdate::parameters.resource, @@ -121,8 +121,8 @@ interface VirtualMachineRunCommands { @@doc(VirtualMachineRunCommands.createOrUpdate::parameters.resource, "Parameters supplied to the Create Virtual Machine RunCommand operation." ); -@@projectedName(VirtualMachineRunCommands.update::parameters.properties, - "json", +@@encodedName(VirtualMachineRunCommands.update::parameters.properties, + "application/json", "runCommand" ); @@extension(VirtualMachineRunCommands.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp index 481e3d1f3..6e5a92db8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp @@ -607,8 +607,8 @@ interface VirtualMachineScaleSets { >; } -@@projectedName(VirtualMachineScaleSets.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachineScaleSets.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSets.createOrUpdate::parameters.resource, @@ -618,8 +618,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.createOrUpdate::parameters.resource, "The scale set object." ); -@@projectedName(VirtualMachineScaleSets.update::parameters.properties, - "json", +@@encodedName(VirtualMachineScaleSets.update::parameters.properties, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSets.update::parameters.properties, @@ -629,8 +629,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.update::parameters.properties, "The scale set object." ); -@@projectedName(VirtualMachineScaleSets.deallocate::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.deallocate::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.deallocate::parameters.body, @@ -640,8 +640,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.deallocate::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.deleteInstances::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.deleteInstances::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.deleteInstances::parameters.body, @@ -651,8 +651,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.deleteInstances::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.powerOff::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.powerOff::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.powerOff::parameters.body, @@ -662,8 +662,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.powerOff::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.restart::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.restart::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.restart::parameters.body, @@ -673,8 +673,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.restart::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.start::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.start::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.start::parameters.body, @@ -684,8 +684,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.start::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.redeploy::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.redeploy::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.redeploy::parameters.body, @@ -695,8 +695,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.redeploy::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.performMaintenance::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.performMaintenance::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.performMaintenance::parameters.body, @@ -706,8 +706,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.performMaintenance::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.updateInstances::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.updateInstances::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.updateInstances::parameters.body, @@ -717,8 +717,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.updateInstances::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.reimage::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.reimage::parameters.body, + "application/json", "vmScaleSetReimageInput" ); @@extension(VirtualMachineScaleSets.reimage::parameters.body, @@ -728,8 +728,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.reimage::parameters.body, "Parameters for Reimaging VM ScaleSet." ); -@@projectedName(VirtualMachineScaleSets.reimageAll::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.reimageAll::parameters.body, + "application/json", "vmInstanceIDs" ); @@extension(VirtualMachineScaleSets.reimageAll::parameters.body, @@ -739,8 +739,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.reimageAll::parameters.body, "A list of virtual machine instance IDs from the VM scale set." ); -@@projectedName(VirtualMachineScaleSets.convertToSinglePlacementGroup::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.convertToSinglePlacementGroup::parameters.body, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSets.convertToSinglePlacementGroup::parameters.body, @@ -750,8 +750,8 @@ interface VirtualMachineScaleSets { @@doc(VirtualMachineScaleSets.convertToSinglePlacementGroup::parameters.body, "The input object for ConvertToSinglePlacementGroup API." ); -@@projectedName(VirtualMachineScaleSets.setOrchestrationServiceState::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSets.setOrchestrationServiceState::parameters.body, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSets.setOrchestrationServiceState::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp index b7c84ac0c..1fbe282a7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp @@ -135,8 +135,8 @@ interface VirtualMachineScaleSetExtensions { >; } -@@projectedName(VirtualMachineScaleSetExtensions.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachineScaleSetExtensions.createOrUpdate::parameters.resource, + "application/json", "extensionParameters" ); @@extension(VirtualMachineScaleSetExtensions.createOrUpdate::parameters.resource, @@ -146,8 +146,8 @@ interface VirtualMachineScaleSetExtensions { @@doc(VirtualMachineScaleSetExtensions.createOrUpdate::parameters.resource, "Parameters supplied to the Create VM scale set Extension operation." ); -@@projectedName(VirtualMachineScaleSetExtensions.update::parameters.properties, - "json", +@@encodedName(VirtualMachineScaleSetExtensions.update::parameters.properties, + "application/json", "extensionParameters" ); @@extension(VirtualMachineScaleSetExtensions.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp index ae943c1f5..ce6adc87e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp @@ -437,8 +437,8 @@ interface VirtualMachineScaleSetVMS { >; } -@@projectedName(VirtualMachineScaleSetVMS.update::parameters.resource, - "json", +@@encodedName(VirtualMachineScaleSetVMS.update::parameters.resource, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSetVMS.update::parameters.resource, @@ -448,8 +448,8 @@ interface VirtualMachineScaleSetVMS { @@doc(VirtualMachineScaleSetVMS.update::parameters.resource, "Parameters supplied to the Update Virtual Machine Scale Sets VM operation." ); -@@projectedName(VirtualMachineScaleSetVMS.reimage::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSetVMS.reimage::parameters.body, + "application/json", "vmScaleSetVMReimageInput" ); @@extension(VirtualMachineScaleSetVMS.reimage::parameters.body, @@ -459,8 +459,8 @@ interface VirtualMachineScaleSetVMS { @@doc(VirtualMachineScaleSetVMS.reimage::parameters.body, "Parameters for the Reimaging Virtual machine in ScaleSet." ); -@@projectedName(VirtualMachineScaleSetVMS.runCommand::parameters.body, - "json", +@@encodedName(VirtualMachineScaleSetVMS.runCommand::parameters.body, + "application/json", "parameters" ); @@extension(VirtualMachineScaleSetVMS.runCommand::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp index 272a8b3e4..81a36cdc5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp @@ -155,8 +155,8 @@ interface VirtualMachineScaleSetVMExtensions { >; } -@@projectedName(VirtualMachineScaleSetVMExtensions.createOrUpdate::parameters.resource, - "json", +@@encodedName(VirtualMachineScaleSetVMExtensions.createOrUpdate::parameters.resource, + "application/json", "extensionParameters" ); @@extension(VirtualMachineScaleSetVMExtensions.createOrUpdate::parameters.resource, @@ -166,8 +166,8 @@ interface VirtualMachineScaleSetVMExtensions { @@doc(VirtualMachineScaleSetVMExtensions.createOrUpdate::parameters.resource, "Parameters supplied to the Create Virtual Machine Extension operation." ); -@@projectedName(VirtualMachineScaleSetVMExtensions.update::parameters.properties, - "json", +@@encodedName(VirtualMachineScaleSetVMExtensions.update::parameters.properties, + "application/json", "extensionParameters" ); @@extension(VirtualMachineScaleSetVMExtensions.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp index b7c2f8953..8f45dd5d7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp @@ -2549,7 +2549,7 @@ model VirtualMachineScaleSetDataDisk { /** * Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. */ - @projectedName("json", "diskIOPSReadWrite") + @encodedName("application/json", "diskIOPSReadWrite") diskIopsReadWrite?: int64; /** @@ -5013,7 +5013,7 @@ model DataDisk { * Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. */ @visibility("read") - @projectedName("json", "diskIOPSReadWrite") + @encodedName("application/json", "diskIOPSReadWrite") diskIopsReadWrite?: int64; /** @@ -5841,7 +5841,7 @@ model VirtualMachineCaptureResult extends SubResource { * the schema of the captured virtual machine */ @visibility("read") - @projectedName("json", "$schema") + @encodedName("application/json", "$schema") schema?: string; /** @@ -7085,7 +7085,7 @@ model RestorePointSourceVMStorageProfile { /** * Gets the data disks of the VM captured at the time of the restore point creation. */ - @projectedName("json", "dataDisks") + @encodedName("application/json", "dataDisks") dataDiskList?: RestorePointSourceVMDataDisk[]; } @@ -7533,7 +7533,7 @@ model RunCommandDocumentBase { /** * The VM run command schema. */ - @projectedName("json", "$schema") + @encodedName("application/json", "$schema") schema: string; /** @@ -7896,7 +7896,7 @@ model DiskProperties { /** * The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ - @projectedName("json", "diskIOPSReadWrite") + @encodedName("application/json", "diskIOPSReadWrite") diskIopsReadWrite?: int64; /** @@ -7907,7 +7907,7 @@ model DiskProperties { /** * The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ - @projectedName("json", "diskIOPSReadOnly") + @encodedName("application/json", "diskIOPSReadOnly") diskIopsReadOnly?: int64; /** @@ -8004,7 +8004,7 @@ model DiskProperties { * The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started. */ @visibility("read") - @projectedName("json", "LastOwnershipUpdateTime") + @encodedName("application/json", "LastOwnershipUpdateTime") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. lastOwnershipUpdateTime?: utcDateTime; } @@ -8310,7 +8310,7 @@ model DiskUpdateProperties { /** * The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ - @projectedName("json", "diskIOPSReadWrite") + @encodedName("application/json", "diskIOPSReadWrite") diskIopsReadWrite?: int64; /** @@ -8321,7 +8321,7 @@ model DiskUpdateProperties { /** * The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ - @projectedName("json", "diskIOPSReadOnly") + @encodedName("application/json", "diskIOPSReadOnly") diskIopsReadOnly?: int64; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp index e3219eaee..4a636e7f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp @@ -184,8 +184,8 @@ interface DnsRecords { >; } -@@projectedName(DnsRecords.createOrUpdate::parameters.resource, - "json", +@@encodedName(DnsRecords.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(DnsRecords.createOrUpdate::parameters.resource, @@ -195,7 +195,10 @@ interface DnsRecords { @@doc(DnsRecords.createOrUpdate::parameters.resource, "Parameters supplied to the CreateOrUpdate operation." ); -@@projectedName(DnsRecords.update::parameters.properties, "json", "parameters"); +@@encodedName(DnsRecords.update::parameters.properties, + "application/json", + "parameters" +); @@extension(DnsRecords.update::parameters.properties, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp index f554d884e..245d3e2ab 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp @@ -179,8 +179,8 @@ interface DnsZones { >; } -@@projectedName(DnsZones.createOrUpdate::parameters.resource, - "json", +@@encodedName(DnsZones.createOrUpdate::parameters.resource, + "application/json", "parameters" ); @@extension(DnsZones.createOrUpdate::parameters.resource, @@ -190,7 +190,10 @@ interface DnsZones { @@doc(DnsZones.createOrUpdate::parameters.resource, "Parameters supplied to the CreateOrUpdate operation." ); -@@projectedName(DnsZones.update::parameters.properties, "json", "parameters"); +@@encodedName(DnsZones.update::parameters.properties, + "application/json", + "parameters" +); @@extension(DnsZones.update::parameters.properties, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp index 7214c6bb6..d6dcbdbb1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp @@ -48,7 +48,7 @@ model RecordSetProperties { /** * The TTL (time-to-live) of the records in the record set. */ - @projectedName("json", "TTL") + @encodedName("application/json", "TTL") ttlInSeconds?: int64; /** @@ -71,13 +71,13 @@ model RecordSetProperties { /** * The list of A records in the record set. */ - @projectedName("json", "ARecords") + @encodedName("application/json", "ARecords") aRecords?: ARecord[]; /** * The list of AAAA records in the record set. */ - @projectedName("json", "AAAARecords") + @encodedName("application/json", "AAAARecords") aaaaRecords?: AaaaRecord[]; /** @@ -93,31 +93,31 @@ model RecordSetProperties { /** * The list of PTR records in the record set. */ - @projectedName("json", "PTRRecords") + @encodedName("application/json", "PTRRecords") ptrRecords?: PtrRecord[]; /** * The list of SRV records in the record set. */ - @projectedName("json", "SRVRecords") + @encodedName("application/json", "SRVRecords") srvRecords?: SrvRecord[]; /** * The list of TXT records in the record set. */ - @projectedName("json", "TXTRecords") + @encodedName("application/json", "TXTRecords") txtRecords?: TxtRecord[]; /** * The CNAME record in the record set. */ - @projectedName("json", "CNAMERecord") + @encodedName("application/json", "CNAMERecord") cnameRecord?: CnameRecord; /** * The SOA record in the record set. */ - @projectedName("json", "SOARecord") + @encodedName("application/json", "SOARecord") soaRecord?: SoaRecord; /** @@ -178,7 +178,7 @@ model NsRecord { /** * The name server name for this NS record. */ - @projectedName("json", "nsdname") + @encodedName("application/json", "nsdname") dnsNSDomainName?: string; } @@ -189,7 +189,7 @@ model PtrRecord { /** * The PTR target domain name for this PTR record. */ - @projectedName("json", "ptrdname") + @encodedName("application/json", "ptrdname") dnsPtrDomainName?: string; } @@ -225,7 +225,7 @@ model TxtRecord { /** * The text value of this TXT record. */ - @projectedName("json", "value") + @encodedName("application/json", "value") values?: string[]; } @@ -261,25 +261,25 @@ model SoaRecord { /** * The refresh value for this SOA record. */ - @projectedName("json", "refreshTime") + @encodedName("application/json", "refreshTime") refreshTimeInSeconds?: int64; /** * The retry time for this SOA record. */ - @projectedName("json", "retryTime") + @encodedName("application/json", "retryTime") retryTimeInSeconds?: int64; /** * The expire time for this SOA record. */ - @projectedName("json", "expireTime") + @encodedName("application/json", "expireTime") expireTimeInSeconds?: int64; /** * The minimum value for this SOA record. By convention this is used to determine the negative caching duration. */ - @projectedName("json", "minimumTTL") + @encodedName("application/json", "minimumTTL") minimumTtlInSeconds?: int64; } @@ -347,21 +347,21 @@ model ZoneProperties { * The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. */ @visibility("read") - @projectedName("json", "maxNumberOfRecordSets") + @encodedName("application/json", "maxNumberOfRecordSets") maxNumberOfRecords?: int64; /** * The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. */ @visibility("read") - @projectedName("json", "maxNumberOfRecordsPerRecordSet") + @encodedName("application/json", "maxNumberOfRecordsPerRecordSet") maxNumberOfRecordsPerRecord?: int64; /** * The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. */ @visibility("read") - @projectedName("json", "numberOfRecordSets") + @encodedName("application/json", "numberOfRecordSets") numberOfRecords?: int64; /** @@ -494,6 +494,6 @@ model RecordSetUpdateParameters { /** * Specifies information about the record set being updated. */ - @projectedName("json", "RecordSet") + @encodedName("application/json", "RecordSet") recordSet?: DnsRecord; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp index 270af3956..cd4804087 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp @@ -108,8 +108,8 @@ interface BatchDeploymentTrackedResources { >; } -@@projectedName(BatchDeploymentTrackedResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(BatchDeploymentTrackedResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(BatchDeploymentTrackedResources.createOrUpdate::parameters.resource, @@ -119,8 +119,8 @@ interface BatchDeploymentTrackedResources { @@doc(BatchDeploymentTrackedResources.createOrUpdate::parameters.resource, "Batch inference deployment definition object." ); -@@projectedName(BatchDeploymentTrackedResources.update::parameters.properties, - "json", +@@encodedName(BatchDeploymentTrackedResources.update::parameters.properties, + "application/json", "body" ); @@extension(BatchDeploymentTrackedResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp index 74f3eebf3..006253330 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp @@ -113,8 +113,8 @@ interface BatchEndpointTrackedResources { >; } -@@projectedName(BatchEndpointTrackedResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(BatchEndpointTrackedResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(BatchEndpointTrackedResources.createOrUpdate::parameters.resource, @@ -124,8 +124,8 @@ interface BatchEndpointTrackedResources { @@doc(BatchEndpointTrackedResources.createOrUpdate::parameters.resource, "Batch inference endpoint definition object." ); -@@projectedName(BatchEndpointTrackedResources.update::parameters.properties, - "json", +@@encodedName(BatchEndpointTrackedResources.update::parameters.properties, + "application/json", "body" ); @@extension(BatchEndpointTrackedResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp index 6a40a83ec..2e5622b9b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp @@ -80,8 +80,8 @@ interface CodeContainerResources { >; } -@@projectedName(CodeContainerResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(CodeContainerResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(CodeContainerResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp index 406340dd7..f94d7d5c8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp @@ -102,8 +102,8 @@ interface CodeVersionResources { >; } -@@projectedName(CodeVersionResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(CodeVersionResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(CodeVersionResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp index 8b0f1e311..0fca7360a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp @@ -80,8 +80,8 @@ interface ComponentContainerResources { >; } -@@projectedName(ComponentContainerResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(ComponentContainerResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(ComponentContainerResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp index cd13182de..8d1fcf6a7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp @@ -97,8 +97,8 @@ interface ComponentVersionResources { >; } -@@projectedName(ComponentVersionResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(ComponentVersionResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(ComponentVersionResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComputeResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComputeResource.tsp index 97b6caf98..aa5b18dd3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComputeResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComputeResource.tsp @@ -141,15 +141,15 @@ updateIdleShutdownSetting is ArmResourceActionSync; } -@@projectedName(DataContainerResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(DataContainerResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(DataContainerResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp index 3be87cb02..65eebff6b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp @@ -115,8 +115,8 @@ interface DataVersionBaseResources { >; } -@@projectedName(DataVersionBaseResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(DataVersionBaseResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(DataVersionBaseResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp index e08a0a841..6a3cd5698 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp @@ -140,8 +140,8 @@ interface DatastoreResources { >; } -@@projectedName(DatastoreResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(DatastoreResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(DatastoreResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp index 656ea14f8..bcaaa3e8a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp @@ -86,8 +86,8 @@ interface EnvironmentContainerResources { >; } -@@projectedName(EnvironmentContainerResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(EnvironmentContainerResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(EnvironmentContainerResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp index 4833f3898..22e5c2d92 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp @@ -103,8 +103,8 @@ interface EnvironmentVersionResources { >; } -@@projectedName(EnvironmentVersionResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(EnvironmentVersionResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(EnvironmentVersionResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp index 04ecaead4..c7b53deae 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp @@ -105,8 +105,8 @@ interface FeaturesetContainers { >; } -@@projectedName(FeaturesetContainers.createOrUpdate::parameters.resource, - "json", +@@encodedName(FeaturesetContainers.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(FeaturesetContainers.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp index 781c924c0..3adfa7f44 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp @@ -160,8 +160,8 @@ interface FeaturesetVersions { >; } -@@projectedName(FeaturesetVersions.createOrUpdate::parameters.resource, - "json", +@@encodedName(FeaturesetVersions.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(FeaturesetVersions.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp index 5d5c2b8bf..4711c1e9a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp @@ -105,8 +105,8 @@ interface FeaturestoreEntityContainers { >; } -@@projectedName(FeaturestoreEntityContainers.createOrUpdate::parameters.resource, - "json", +@@encodedName(FeaturestoreEntityContainers.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(FeaturestoreEntityContainers.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp index 1f67d7468..9984935b9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp @@ -117,8 +117,8 @@ interface FeaturestoreEntityVersions { >; } -@@projectedName(FeaturestoreEntityVersions.createOrUpdate::parameters.resource, - "json", +@@encodedName(FeaturestoreEntityVersions.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(FeaturestoreEntityVersions.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp index 1887c8079..5e13955d1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp @@ -130,8 +130,8 @@ interface JobBaseResources { cancel is ArmResourceActionAsync; } -@@projectedName(JobBaseResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(JobBaseResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(JobBaseResources.createOrUpdate::parameters.resource, @@ -141,7 +141,10 @@ interface JobBaseResources { @@doc(JobBaseResources.createOrUpdate::parameters.resource, "Job definition object." ); -@@projectedName(JobBaseResources.update::parameters.properties, "json", "body"); +@@encodedName(JobBaseResources.update::parameters.properties, + "application/json", + "body" +); @@extension(JobBaseResources.update::parameters.properties, "x-ms-client-name", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp index ccaf32be8..8958db821 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp @@ -115,8 +115,8 @@ interface LabelingJobs { resume is ArmResourceActionAsync; } -@@projectedName(LabelingJobs.createOrUpdate::parameters.resource, - "json", +@@encodedName(LabelingJobs.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(LabelingJobs.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp index 31ab0481e..12c30ea11 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp @@ -86,8 +86,8 @@ interface ModelContainerResources { >; } -@@projectedName(ModelContainerResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(ModelContainerResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(ModelContainerResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp index 2209edf12..ef3c1aefc 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp @@ -137,8 +137,8 @@ interface ModelVersionResources { >; } -@@projectedName(ModelVersionResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(ModelVersionResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(ModelVersionResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp index 23b99d02b..cbe509ed5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp @@ -179,8 +179,8 @@ interface OnlineDeploymentTrackedResources { >; } -@@projectedName(OnlineDeploymentTrackedResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(OnlineDeploymentTrackedResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(OnlineDeploymentTrackedResources.createOrUpdate::parameters.resource, @@ -190,8 +190,8 @@ interface OnlineDeploymentTrackedResources { @@doc(OnlineDeploymentTrackedResources.createOrUpdate::parameters.resource, "Inference Endpoint entity to apply during operation." ); -@@projectedName(OnlineDeploymentTrackedResources.update::parameters.properties, - "json", +@@encodedName(OnlineDeploymentTrackedResources.update::parameters.properties, + "application/json", "body" ); @@extension(OnlineDeploymentTrackedResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp index 7f482cb70..8050a474a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp @@ -165,8 +165,8 @@ interface OnlineEndpointTrackedResources { >; } -@@projectedName(OnlineEndpointTrackedResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(OnlineEndpointTrackedResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(OnlineEndpointTrackedResources.createOrUpdate::parameters.resource, @@ -176,8 +176,8 @@ interface OnlineEndpointTrackedResources { @@doc(OnlineEndpointTrackedResources.createOrUpdate::parameters.resource, "Online Endpoint entity to apply during operation." ); -@@projectedName(OnlineEndpointTrackedResources.update::parameters.properties, - "json", +@@encodedName(OnlineEndpointTrackedResources.update::parameters.properties, + "application/json", "body" ); @@extension(OnlineEndpointTrackedResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp index 826237bae..c85f93ed8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp @@ -69,8 +69,8 @@ interface OutboundRuleBasicResources { list is ArmResourceListByParent; } -@@projectedName(OutboundRuleBasicResources.createOrUpdate::parameters.resource, - "json", +@@encodedName(OutboundRuleBasicResources.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(OutboundRuleBasicResources.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp index 63881ac5f..4545051a4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp @@ -68,8 +68,8 @@ interface PrivateEndpointConnections { list is ArmResourceListByParent; } -@@projectedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, - "json", +@@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, + "application/json", "body" ); @@extension(PrivateEndpointConnections.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp index 10d26f91f..9fbbfede5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp @@ -83,7 +83,10 @@ interface Registries { removeRegions is ArmResourceActionAsync; } -@@projectedName(Registries.createOrUpdate::parameters.resource, "json", "body"); +@@encodedName(Registries.createOrUpdate::parameters.resource, + "application/json", + "body" +); @@extension(Registries.createOrUpdate::parameters.resource, "x-ms-client-name", "body" @@ -91,7 +94,10 @@ interface Registries { @@doc(Registries.createOrUpdate::parameters.resource, "Details required to create the registry." ); -@@projectedName(Registries.update::parameters.properties, "json", "body"); +@@encodedName(Registries.update::parameters.properties, + "application/json", + "body" +); @@extension(Registries.update::parameters.properties, "x-ms-client-name", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp index bc17696b7..bd69d9837 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp @@ -79,7 +79,10 @@ interface Schedules { >; } -@@projectedName(Schedules.createOrUpdate::parameters.resource, "json", "body"); +@@encodedName(Schedules.createOrUpdate::parameters.resource, + "application/json", + "body" +); @@extension(Schedules.createOrUpdate::parameters.resource, "x-ms-client-name", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp index f5bc11ed8..2e9467ded 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp @@ -286,7 +286,10 @@ Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds" >; } -@@projectedName(Workspaces.createOrUpdate::parameters.resource, "json", "body"); +@@encodedName(Workspaces.createOrUpdate::parameters.resource, + "application/json", + "body" +); @@extension(Workspaces.createOrUpdate::parameters.resource, "x-ms-client-name", "body" @@ -294,7 +297,10 @@ Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds" @@doc(Workspaces.createOrUpdate::parameters.resource, "The parameters for creating or updating a machine learning workspace." ); -@@projectedName(Workspaces.update::parameters.properties, "json", "body"); +@@encodedName(Workspaces.update::parameters.properties, + "application/json", + "body" +); @@extension(Workspaces.update::parameters.properties, "x-ms-client-name", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp index 81312833b..b36bfd075 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp @@ -105,8 +105,8 @@ interface WorkspaceConnectionPropertiesV2BasicResources { >; } -@@projectedName(WorkspaceConnectionPropertiesV2BasicResources.create::parameters.resource, - "json", +@@encodedName(WorkspaceConnectionPropertiesV2BasicResources.create::parameters.resource, + "application/json", "body" ); @@extension(WorkspaceConnectionPropertiesV2BasicResources.create::parameters.resource, @@ -116,8 +116,8 @@ interface WorkspaceConnectionPropertiesV2BasicResources { @@doc(WorkspaceConnectionPropertiesV2BasicResources.create::parameters.resource, "The object for creating or updating a new workspace connection" ); -@@projectedName(WorkspaceConnectionPropertiesV2BasicResources.update::parameters.properties, - "json", +@@encodedName(WorkspaceConnectionPropertiesV2BasicResources.update::parameters.properties, + "application/json", "body" ); @@extension(WorkspaceConnectionPropertiesV2BasicResources.update::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp index 933cbe0cc..7a7a2757a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp @@ -211,8 +211,8 @@ interface Catalogs { >; } -@@projectedName(Catalogs.listDeviceGroups::parameters.body, - "json", +@@encodedName(Catalogs.listDeviceGroups::parameters.body, + "application/json", "listDeviceGroupsRequest" ); @@extension(Catalogs.listDeviceGroups::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp index ba2e754fa..916e111d2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp @@ -89,8 +89,8 @@ interface Certificates { >; } -@@projectedName(Certificates.retrieveProofOfPossessionNonce::parameters.body, - "json", +@@encodedName(Certificates.retrieveProofOfPossessionNonce::parameters.body, + "application/json", "proofOfPossessionNonceRequest" ); @@extension(Certificates.retrieveProofOfPossessionNonce::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp index 0e2071d36..43381f071 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp @@ -68,8 +68,8 @@ interface Devices { >; } -@@projectedName(Devices.generateCapabilityImage::parameters.body, - "json", +@@encodedName(Devices.generateCapabilityImage::parameters.body, + "application/json", "generateDeviceCapabilityRequest" ); @@extension(Devices.generateCapabilityImage::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp index d461df31b..b1a291d17 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp @@ -101,8 +101,8 @@ interface DeviceGroups { countDevices is ArmResourceActionSync; } -@@projectedName(DeviceGroups.claimDevices::parameters.body, - "json", +@@encodedName(DeviceGroups.claimDevices::parameters.body, + "application/json", "claimDevicesRequest" ); @@extension(DeviceGroups.claimDevices::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp index f83f478a7..e45c7087c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp @@ -117,8 +117,8 @@ interface BlobContainers { objectLevelWorm is ArmResourceActionAsync; } -@@projectedName(BlobContainers.create::parameters.resource, - "json", +@@encodedName(BlobContainers.create::parameters.resource, + "application/json", "blobContainer" ); @@extension(BlobContainers.create::parameters.resource, @@ -128,8 +128,8 @@ interface BlobContainers { @@doc(BlobContainers.create::parameters.resource, "Properties of the blob container to create." ); -@@projectedName(BlobContainers.update::parameters.properties, - "json", +@@encodedName(BlobContainers.update::parameters.properties, + "application/json", "blobContainer" ); @@extension(BlobContainers.update::parameters.properties, @@ -139,8 +139,8 @@ interface BlobContainers { @@doc(BlobContainers.update::parameters.properties, "Properties to update for the blob container." ); -@@projectedName(BlobContainers.setLegalHold::parameters.body, - "json", +@@encodedName(BlobContainers.setLegalHold::parameters.body, + "application/json", "LegalHold" ); @@extension(BlobContainers.setLegalHold::parameters.body, @@ -150,8 +150,8 @@ interface BlobContainers { @@doc(BlobContainers.setLegalHold::parameters.body, "The LegalHold property that will be set to a blob container." ); -@@projectedName(BlobContainers.clearLegalHold::parameters.body, - "json", +@@encodedName(BlobContainers.clearLegalHold::parameters.body, + "application/json", "LegalHold" ); @@extension(BlobContainers.clearLegalHold::parameters.body, @@ -161,7 +161,10 @@ interface BlobContainers { @@doc(BlobContainers.clearLegalHold::parameters.body, "The LegalHold property that will be clear from a blob container." ); -@@projectedName(BlobContainers.lease::parameters.body, "json", "parameters"); +@@encodedName(BlobContainers.lease::parameters.body, + "application/json", + "parameters" +); @@extension(BlobContainers.lease::parameters.body, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp index 56651e385..e3e98e5b3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp @@ -61,8 +61,8 @@ interface BlobInventoryPolicies { list is ArmResourceListByParent; } -@@projectedName(BlobInventoryPolicies.createOrUpdate::parameters.resource, - "json", +@@encodedName(BlobInventoryPolicies.createOrUpdate::parameters.resource, + "application/json", "properties" ); @@extension(BlobInventoryPolicies.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp index 75a2e1b1b..e1cfc6817 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp @@ -39,7 +39,6 @@ model BlobServiceProperties extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "BlobServiceProperties") interface BlobServicePropertiesOperationGroup { /** * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -63,8 +62,8 @@ interface BlobServicePropertiesOperationGroup { list is ArmResourceListByParent; } -@@projectedName(BlobServicePropertiesOperationGroup.setServiceProperties::parameters.resource, - "json", +@@encodedName(BlobServicePropertiesOperationGroup.setServiceProperties::parameters.resource, + "application/json", "parameters" ); @@extension(BlobServicePropertiesOperationGroup.setServiceProperties::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp index 45ca61bad..e6316e011 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp @@ -90,8 +90,8 @@ interface EncryptionScopes { >; } -@@projectedName(EncryptionScopes.put::parameters.resource, - "json", +@@encodedName(EncryptionScopes.put::parameters.resource, + "application/json", "encryptionScope" ); @@extension(EncryptionScopes.put::parameters.resource, @@ -101,8 +101,8 @@ interface EncryptionScopes { @@doc(EncryptionScopes.put::parameters.resource, "Encryption scope properties to be used for the create or update." ); -@@projectedName(EncryptionScopes.patch::parameters.properties, - "json", +@@encodedName(EncryptionScopes.patch::parameters.properties, + "application/json", "encryptionScope" ); @@extension(EncryptionScopes.patch::parameters.properties, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp index cbcd3d526..ec2cac71b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp @@ -39,7 +39,6 @@ model FileServiceProperties extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "FileServiceProperties") interface FileServicePropertiesOperationGroup { /** * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -63,8 +62,8 @@ interface FileServicePropertiesOperationGroup { list is ArmResourceListByParent; } -@@projectedName(FileServicePropertiesOperationGroup.setServiceProperties::parameters.resource, - "json", +@@encodedName(FileServicePropertiesOperationGroup.setServiceProperties::parameters.resource, + "application/json", "parameters" ); @@extension(FileServicePropertiesOperationGroup.setServiceProperties::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp index f84bff7d7..f93bcd8a1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp @@ -161,7 +161,10 @@ interface FileShares { >; } -@@projectedName(FileShares.create::parameters.resource, "json", "fileShare"); +@@encodedName(FileShares.create::parameters.resource, + "application/json", + "fileShare" +); @@extension(FileShares.create::parameters.resource, "x-ms-client-name", "fileShare" @@ -169,7 +172,10 @@ interface FileShares { @@doc(FileShares.create::parameters.resource, "Properties of the file share to create." ); -@@projectedName(FileShares.update::parameters.properties, "json", "fileShare"); +@@encodedName(FileShares.update::parameters.properties, + "application/json", + "fileShare" +); @@extension(FileShares.update::parameters.properties, "x-ms-client-name", "fileShare" @@ -177,13 +183,19 @@ interface FileShares { @@doc(FileShares.update::parameters.properties, "Properties to update for the file share." ); -@@projectedName(FileShares.restore::parameters.body, "json", "deletedShare"); +@@encodedName(FileShares.restore::parameters.body, + "application/json", + "deletedShare" +); @@extension(FileShares.restore::parameters.body, "x-ms-client-name", "deletedShare" ); @@doc(FileShares.restore::parameters.body, ""); -@@projectedName(FileShares.lease::parameters.body, "json", "parameters"); +@@encodedName(FileShares.lease::parameters.body, + "application/json", + "parameters" +); @@extension(FileShares.lease::parameters.body, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp index 506595dd0..d2683701f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp @@ -131,8 +131,8 @@ interface ImmutabilityPolicies { >; } -@@projectedName(ImmutabilityPolicies.createOrUpdateImmutabilityPolicy::parameters.resource, - "json", +@@encodedName(ImmutabilityPolicies.createOrUpdateImmutabilityPolicy::parameters.resource, + "application/json", "parameters" ); @@extension(ImmutabilityPolicies.createOrUpdateImmutabilityPolicy::parameters.resource, @@ -142,8 +142,8 @@ interface ImmutabilityPolicies { @@doc(ImmutabilityPolicies.createOrUpdateImmutabilityPolicy::parameters.resource, "The ImmutabilityPolicy Properties that will be created or updated to a blob container." ); -@@projectedName(ImmutabilityPolicies.extendImmutabilityPolicy::parameters.body, - "json", +@@encodedName(ImmutabilityPolicies.extendImmutabilityPolicy::parameters.body, + "application/json", "parameters" ); @@extension(ImmutabilityPolicies.extendImmutabilityPolicy::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp index 310f61b21..27cc3a35c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp @@ -78,8 +78,8 @@ interface LocalUsers { >; } -@@projectedName(LocalUsers.createOrUpdate::parameters.resource, - "json", +@@encodedName(LocalUsers.createOrUpdate::parameters.resource, + "application/json", "properties" ); @@extension(LocalUsers.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp index 6f654b1a6..570855af8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp @@ -52,8 +52,8 @@ interface ManagementPolicies { delete is ArmResourceDeleteSync; } -@@projectedName(ManagementPolicies.createOrUpdate::parameters.resource, - "json", +@@encodedName(ManagementPolicies.createOrUpdate::parameters.resource, + "application/json", "properties" ); @@extension(ManagementPolicies.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp index ac3d3e150..f2a6a67c9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp @@ -65,8 +65,8 @@ interface ObjectReplicationPolicies { list is ArmResourceListByParent; } -@@projectedName(ObjectReplicationPolicies.createOrUpdate::parameters.resource, - "json", +@@encodedName(ObjectReplicationPolicies.createOrUpdate::parameters.resource, + "application/json", "properties" ); @@extension(ObjectReplicationPolicies.createOrUpdate::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp index f0ae704f7..b03c94855 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp @@ -64,8 +64,8 @@ interface PrivateEndpointConnections { list is ArmResourceListByParent; } -@@projectedName(PrivateEndpointConnections.put::parameters.resource, - "json", +@@encodedName(PrivateEndpointConnections.put::parameters.resource, + "application/json", "properties" ); @@extension(PrivateEndpointConnections.put::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp index e8763d8b6..ed4b8c6d6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp @@ -37,7 +37,6 @@ model QueueServiceProperties extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "QueueServiceProperties") interface QueueServicePropertiesOperationGroup { /** * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -61,8 +60,8 @@ interface QueueServicePropertiesOperationGroup { list is ArmResourceListByParent; } -@@projectedName(QueueServicePropertiesOperationGroup.setServiceProperties::parameters.resource, - "json", +@@encodedName(QueueServicePropertiesOperationGroup.setServiceProperties::parameters.resource, + "application/json", "parameters" ); @@extension(QueueServicePropertiesOperationGroup.setServiceProperties::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp index 01209c379..26272f12f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp @@ -251,8 +251,8 @@ interface StorageAccounts { >; } -@@projectedName(StorageAccounts.create::parameters.resource, - "json", +@@encodedName(StorageAccounts.create::parameters.resource, + "application/json", "parameters" ); @@extension(StorageAccounts.create::parameters.resource, @@ -262,8 +262,8 @@ interface StorageAccounts { @@doc(StorageAccounts.create::parameters.resource, "The parameters to provide for the created account." ); -@@projectedName(StorageAccounts.update::parameters.properties, - "json", +@@encodedName(StorageAccounts.update::parameters.properties, + "application/json", "parameters" ); @@extension(StorageAccounts.update::parameters.properties, @@ -273,8 +273,8 @@ interface StorageAccounts { @@doc(StorageAccounts.update::parameters.properties, "The parameters to provide for the updated account." ); -@@projectedName(StorageAccounts.regenerateKey::parameters.body, - "json", +@@encodedName(StorageAccounts.regenerateKey::parameters.body, + "application/json", "regenerateKey" ); @@extension(StorageAccounts.regenerateKey::parameters.body, @@ -284,8 +284,8 @@ interface StorageAccounts { @@doc(StorageAccounts.regenerateKey::parameters.body, "Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2." ); -@@projectedName(StorageAccounts.listAccountSAS::parameters.body, - "json", +@@encodedName(StorageAccounts.listAccountSAS::parameters.body, + "application/json", "parameters" ); @@extension(StorageAccounts.listAccountSAS::parameters.body, @@ -295,8 +295,8 @@ interface StorageAccounts { @@doc(StorageAccounts.listAccountSAS::parameters.body, "The parameters to provide to list SAS credentials for the storage account." ); -@@projectedName(StorageAccounts.listServiceSAS::parameters.body, - "json", +@@encodedName(StorageAccounts.listServiceSAS::parameters.body, + "application/json", "parameters" ); @@extension(StorageAccounts.listServiceSAS::parameters.body, @@ -306,8 +306,8 @@ interface StorageAccounts { @@doc(StorageAccounts.listServiceSAS::parameters.body, "The parameters to provide to list service SAS credentials." ); -@@projectedName(StorageAccounts.restoreBlobRanges::parameters.body, - "json", +@@encodedName(StorageAccounts.restoreBlobRanges::parameters.body, + "application/json", "parameters" ); @@extension(StorageAccounts.restoreBlobRanges::parameters.body, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp index b01aa796c..eb4b587a9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp @@ -94,7 +94,10 @@ interface StorageQueues { >; } -@@projectedName(StorageQueues.create::parameters.resource, "json", "queue"); +@@encodedName(StorageQueues.create::parameters.resource, + "application/json", + "queue" +); @@extension(StorageQueues.create::parameters.resource, "x-ms-client-name", "queue" @@ -102,7 +105,10 @@ interface StorageQueues { @@doc(StorageQueues.create::parameters.resource, "Queue properties and metadata to be created with" ); -@@projectedName(StorageQueues.update::parameters.properties, "json", "queue"); +@@encodedName(StorageQueues.update::parameters.properties, + "application/json", + "queue" +); @@extension(StorageQueues.update::parameters.properties, "x-ms-client-name", "queue" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp index 21c1a4f9d..34e3927a9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp @@ -79,7 +79,10 @@ interface Tables { list is ArmResourceListByParent; } -@@projectedName(Tables.create::parameters.resource, "json", "parameters"); +@@encodedName(Tables.create::parameters.resource, + "application/json", + "parameters" +); @@extension(Tables.create::parameters.resource, "x-ms-client-name", "parameters" @@ -87,7 +90,10 @@ interface Tables { @@doc(Tables.create::parameters.resource, "The parameters to provide to create a table." ); -@@projectedName(Tables.update::parameters.properties, "json", "parameters"); +@@encodedName(Tables.update::parameters.properties, + "application/json", + "parameters" +); @@extension(Tables.update::parameters.properties, "x-ms-client-name", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp index b1c0f7514..d891ace99 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp @@ -37,7 +37,6 @@ model TableServiceProperties extends ProxyResourceBase { } @armResourceOperations -@projectedName("client", "TableServiceProperties") interface TableServicePropertiesOperationGroup { /** * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -61,8 +60,8 @@ interface TableServicePropertiesOperationGroup { list is ArmResourceListByParent; } -@@projectedName(TableServicePropertiesOperationGroup.setServiceProperties::parameters.resource, - "json", +@@encodedName(TableServicePropertiesOperationGroup.setServiceProperties::parameters.resource, + "application/json", "parameters" ); @@extension(TableServicePropertiesOperationGroup.setServiceProperties::parameters.resource, diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp index baf43ba2d..3c61dda0a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp @@ -24,3 +24,11 @@ using Microsoft.Storage; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(ListQueue.queueProperties); + +@@clientName(BlobServicePropertiesOperationGroup, "BlobServiceProperties"); + +@@clientName(FileServicePropertiesOperationGroup, "FileServiceProperties"); + +@@clientName(QueueServicePropertiesOperationGroup, "QueueServiceProperties"); + +@@clientName(TableServicePropertiesOperationGroup, "TableServiceProperties"); diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp index 13c0238e8..3244b1ca6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp @@ -922,7 +922,7 @@ model StorageAccountPropertiesCreateParameters { /** * Network rule set */ - @projectedName("json", "networkAcls") + @encodedName("application/json", "networkAcls") networkRuleSet?: NetworkRuleSet; /** @@ -938,25 +938,25 @@ model StorageAccountPropertiesCreateParameters { /** * Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. */ - @projectedName("json", "supportsHttpsTrafficOnly") + @encodedName("application/json", "supportsHttpsTrafficOnly") enableHttpsTrafficOnly?: boolean; /** * Enables Secure File Transfer Protocol, if set to true */ - @projectedName("json", "isSftpEnabled") + @encodedName("application/json", "isSftpEnabled") IsSftpEnabled?: boolean; /** * Enables local users feature, if set to true */ - @projectedName("json", "isLocalUserEnabled") + @encodedName("application/json", "isLocalUserEnabled") IsLocalUserEnabled?: boolean; /** * Account HierarchicalNamespace enabled if sets to true. */ - @projectedName("json", "isHnsEnabled") + @encodedName("application/json", "isHnsEnabled") IsHnsEnabled?: boolean; /** @@ -987,7 +987,7 @@ model StorageAccountPropertiesCreateParameters { /** * NFS 3.0 protocol support enabled if set to true. */ - @projectedName("json", "isNfsV3Enabled") + @encodedName("application/json", "isNfsV3Enabled") enableNfsV3?: boolean; /** @@ -1073,13 +1073,13 @@ model Encryption { /** * Properties provided by key vault. */ - @projectedName("json", "keyvaultproperties") + @encodedName("application/json", "keyvaultproperties") keyVaultProperties?: KeyVaultProperties; /** * The identity to be used with service-side encryption at rest. */ - @projectedName("json", "identity") + @encodedName("application/json", "identity") encryptionIdentity?: EncryptionIdentity; } @@ -1138,19 +1138,19 @@ model KeyVaultProperties { /** * The name of KeyVault key. */ - @projectedName("json", "keyname") + @encodedName("application/json", "keyname") keyName?: string; /** * The version of KeyVault key. */ - @projectedName("json", "keyversion") + @encodedName("application/json", "keyversion") keyVersion?: string; /** * The Uri of KeyVault. */ - @projectedName("json", "keyvaulturi") + @encodedName("application/json", "keyvaulturi") keyVaultUri?: string; /** @@ -1181,13 +1181,13 @@ model EncryptionIdentity { /** * Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. */ - @projectedName("json", "userAssignedIdentity") + @encodedName("application/json", "userAssignedIdentity") encryptionUserAssignedIdentity?: string; /** * ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. */ - @projectedName("json", "federatedIdentityClientId") + @encodedName("application/json", "federatedIdentityClientId") encryptionFederatedIdentityClientId?: string; } @@ -1243,7 +1243,7 @@ model VirtualNetworkRule { /** * Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ - @projectedName("json", "id") + @encodedName("application/json", "id") virtualNetworkResourceId: string; /** @@ -1264,7 +1264,7 @@ model IPRule { /** * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. */ - @projectedName("json", "value") + @encodedName("application/json", "value") IPAddressOrRange: string; /** @@ -1499,32 +1499,32 @@ model StorageAccountProperties { /** * Allows https traffic only to storage service if sets to true. */ - @projectedName("json", "supportsHttpsTrafficOnly") + @encodedName("application/json", "supportsHttpsTrafficOnly") enableHttpsTrafficOnly?: boolean; /** * Network rule set */ @visibility("read") - @projectedName("json", "networkAcls") + @encodedName("application/json", "networkAcls") networkRuleSet?: NetworkRuleSet; /** * Enables Secure File Transfer Protocol, if set to true */ - @projectedName("json", "isSftpEnabled") + @encodedName("application/json", "isSftpEnabled") IsSftpEnabled?: boolean; /** * Enables local users feature, if set to true */ - @projectedName("json", "isLocalUserEnabled") + @encodedName("application/json", "isLocalUserEnabled") IsLocalUserEnabled?: boolean; /** * Account HierarchicalNamespace enabled if sets to true. */ - @projectedName("json", "isHnsEnabled") + @encodedName("application/json", "isHnsEnabled") IsHnsEnabled?: boolean; /** @@ -1579,7 +1579,7 @@ model StorageAccountProperties { /** * NFS 3.0 protocol support enabled if set to true. */ - @projectedName("json", "isNfsV3Enabled") + @encodedName("application/json", "isNfsV3Enabled") enableNfsV3?: boolean; /** @@ -1885,7 +1885,7 @@ model BlobRestoreParameters { /** * Restore blob to the specified time. */ - @projectedName("json", "timetoRestore") + @encodedName("application/json", "timetoRestore") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. timeToRestore: utcDateTime; @@ -2007,25 +2007,25 @@ model StorageAccountPropertiesUpdateParameters { /** * Allows https traffic only to storage service if sets to true. */ - @projectedName("json", "supportsHttpsTrafficOnly") + @encodedName("application/json", "supportsHttpsTrafficOnly") enableHttpsTrafficOnly?: boolean; /** * Enables Secure File Transfer Protocol, if set to true */ - @projectedName("json", "isSftpEnabled") + @encodedName("application/json", "isSftpEnabled") IsSftpEnabled?: boolean; /** * Enables local users feature, if set to true */ - @projectedName("json", "isLocalUserEnabled") + @encodedName("application/json", "isLocalUserEnabled") IsLocalUserEnabled?: boolean; /** * Network rule set */ - @projectedName("json", "networkAcls") + @encodedName("application/json", "networkAcls") networkRuleSet?: NetworkRuleSet; /** @@ -2254,44 +2254,44 @@ model AccountSasParameters { /** * The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). */ - @projectedName("json", "signedServices") + @encodedName("application/json", "signedServices") services: Services; /** * The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. */ - @projectedName("json", "signedResourceTypes") + @encodedName("application/json", "signedResourceTypes") resourceTypes: SignedResourceTypes; /** * The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). */ - @projectedName("json", "signedPermission") + @encodedName("application/json", "signedPermission") permissions: Permissions; /** * An IP address or a range of IP addresses from which to accept requests. */ - @projectedName("json", "signedIp") + @encodedName("application/json", "signedIp") IPAddressOrRange?: string; /** * The protocol permitted for a request made with the account SAS. */ - @projectedName("json", "signedProtocol") + @encodedName("application/json", "signedProtocol") protocols?: HttpProtocol; /** * The time at which the SAS becomes valid. */ - @projectedName("json", "signedStart") + @encodedName("application/json", "signedStart") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. sharedAccessStartTime?: utcDateTime; /** * The time at which the shared access signature becomes invalid. */ - @projectedName("json", "signedExpiry") + @encodedName("application/json", "signedExpiry") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. sharedAccessExpiryTime: utcDateTime; @@ -2324,38 +2324,38 @@ model ServiceSasParameters { /** * The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). */ - @projectedName("json", "signedResource") + @encodedName("application/json", "signedResource") resource?: SignedResource; /** * The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). */ - @projectedName("json", "signedPermission") + @encodedName("application/json", "signedPermission") permissions?: Permissions; /** * An IP address or a range of IP addresses from which to accept requests. */ - @projectedName("json", "signedIp") + @encodedName("application/json", "signedIp") IPAddressOrRange?: string; /** * The protocol permitted for a request made with the account SAS. */ - @projectedName("json", "signedProtocol") + @encodedName("application/json", "signedProtocol") protocols?: HttpProtocol; /** * The time at which the SAS becomes valid. */ - @projectedName("json", "signedStart") + @encodedName("application/json", "signedStart") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. sharedAccessStartTime?: utcDateTime; /** * The time at which the shared access signature becomes invalid. */ - @projectedName("json", "signedExpiry") + @encodedName("application/json", "signedExpiry") // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. sharedAccessExpiryTime?: utcDateTime; @@ -2363,31 +2363,31 @@ model ServiceSasParameters { * A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. */ @maxLength(64) - @projectedName("json", "signedIdentifier") + @encodedName("application/json", "signedIdentifier") identifier?: string; /** * The start of partition key. */ - @projectedName("json", "startPk") + @encodedName("application/json", "startPk") partitionKeyStart?: string; /** * The end of partition key. */ - @projectedName("json", "endPk") + @encodedName("application/json", "endPk") partitionKeyEnd?: string; /** * The start of row key. */ - @projectedName("json", "startRk") + @encodedName("application/json", "startRk") rowKeyStart?: string; /** * The end of row key. */ - @projectedName("json", "endRk") + @encodedName("application/json", "endRk") rowKeyEnd?: string; /** @@ -2398,31 +2398,31 @@ model ServiceSasParameters { /** * The response header override for cache control. */ - @projectedName("json", "rscc") + @encodedName("application/json", "rscc") cacheControl?: string; /** * The response header override for content disposition. */ - @projectedName("json", "rscd") + @encodedName("application/json", "rscd") contentDisposition?: string; /** * The response header override for content encoding. */ - @projectedName("json", "rsce") + @encodedName("application/json", "rsce") contentEncoding?: string; /** * The response header override for content language. */ - @projectedName("json", "rscl") + @encodedName("application/json", "rscl") contentLanguage?: string; /** * The response header override for content type. */ - @projectedName("json", "rsct") + @encodedName("application/json", "rsct") contentType?: string; } @@ -4100,7 +4100,7 @@ model ListQueue extends Resource { /** * List Queue resource properties. */ - @projectedName("json", "properties") + @encodedName("application/json", "properties") queueProperties?: ListQueueProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/batch/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/batch/tsp-output/client.tsp deleted file mode 100644 index 95d80ffea..000000000 --- a/packages/extensions/openapi-to-typespec/test/batch/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.Batch; diff --git a/packages/extensions/openapi-to-typespec/test/batch/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/batch/tsp-output/models.tsp index 86ecd1fc8..34a49a677 100644 --- a/packages/extensions/openapi-to-typespec/test/batch/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/batch/tsp-output/models.tsp @@ -1110,7 +1110,7 @@ model ApplicationListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -1204,7 +1204,7 @@ model PoolListUsageMetricsResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -1260,7 +1260,7 @@ model AccountListSupportedImagesResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -1372,7 +1372,7 @@ model PoolNodeCountsListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -1837,7 +1837,7 @@ model CertificateListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -1857,7 +1857,7 @@ model NodeFileListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -2423,7 +2423,7 @@ model ContainerRegistry { /** * The user name to log into the registry server. */ - @projectedName("json", "username") + @encodedName("application/json", "username") userName?: string; /** @@ -2677,7 +2677,7 @@ model UserIdentity { * The userName and autoUser properties are mutually exclusive; you must specify * one but not both. */ - @projectedName("json", "username") + @encodedName("application/json", "username") userName?: string; /** @@ -4159,7 +4159,7 @@ model BatchJobScheduleListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -4534,7 +4534,7 @@ model BatchJobListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -4554,7 +4554,7 @@ model BatchJobListPreparationAndReleaseTaskStatusResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -5256,7 +5256,7 @@ model BatchPoolListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -5998,7 +5998,7 @@ model BatchTaskListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -6546,7 +6546,7 @@ model InboundEndpoint { /** * The public fully qualified domain name for the Compute Node. */ - @projectedName("json", "publicFQDN") + @encodedName("application/json", "publicFQDN") publicFqdn: string; /** @@ -6710,7 +6710,7 @@ model ComputeNodeListResult { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @@ -6799,6 +6799,6 @@ model NodeVMExtensionList { * The URL to get the next set of results. */ @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } diff --git a/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/models.tsp index 667b67a1a..211747ad7 100644 --- a/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/models.tsp @@ -75,18 +75,18 @@ model FloatWrapper { model DoubleWrapper { field1?: float64; - @projectedName( - "json", + @encodedName( + "application/json", "field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose" ) field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose?: float64; } model BooleanWrapper { - @projectedName("json", "field_true") + @encodedName("application/json", "field_true") fieldTrue?: boolean; - @projectedName("json", "field_false") + @encodedName("application/json", "field_false") fieldFalse?: boolean; } @@ -209,7 +209,7 @@ model MyBaseHelperType { model SmartSalmon extends Salmon { ...Record; - @projectedName("json", "college_degree") + @encodedName("application/json", "college_degree") collegeDegree?: string; fishtype: "smart_salmon"; diff --git a/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/client.tsp deleted file mode 100644 index bc410fa86..000000000 --- a/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using ComplexModelClient; diff --git a/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/models.tsp index 1d5b53f12..64023ad24 100644 --- a/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/complexObject/tsp-output/models.tsp @@ -22,7 +22,7 @@ model Product { * longitude. For example, uberX in San Francisco will have a different product_id * than uberX in Los Angeles. */ - @projectedName("json", "product_id") + @encodedName("application/json", "product_id") productId?: string; /** @@ -33,7 +33,7 @@ model Product { /** * Display name of product. */ - @projectedName("json", "display_name") + @encodedName("application/json", "display_name") displayName?: string; /** diff --git a/packages/extensions/openapi-to-typespec/test/confidentialLedger/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/confidentialLedger/tsp-output/client.tsp deleted file mode 100644 index 351ef61b8..000000000 --- a/packages/extensions/openapi-to-typespec/test/confidentialLedger/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.Language.Authoring; diff --git a/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/models.tsp index 9b8b9e417..b54acdf78 100644 --- a/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/models.tsp @@ -609,7 +609,7 @@ model Error { * The key vault server error. */ @visibility("read") - @projectedName("json", "innererror") + @encodedName("application/json", "innererror") innerError?: Error; } @@ -740,7 +740,7 @@ model CertificateItem { /** * Thumbprint of the certificate. */ - @projectedName("json", "x5t") + @encodedName("application/json", "x5t") x509Thumbprint?: bytes; } @@ -777,13 +777,13 @@ model Attributes { /** * Not before date in UTC. */ - @projectedName("json", "nbf") + @encodedName("application/json", "nbf") notBefore?: plainTime; /** * Expiry date in UTC. */ - @projectedName("json", "exp") + @encodedName("application/json", "exp") expires?: plainTime; /** @@ -849,7 +849,7 @@ model CertificateBundle { * Thumbprint of the certificate. */ @visibility("read") - @projectedName("json", "x5t") + @encodedName("application/json", "x5t") x509Thumbprint?: bytes; /** @@ -893,31 +893,31 @@ model CertificatePolicy { /** * Properties of the key backing a certificate. */ - @projectedName("json", "key_props") + @encodedName("application/json", "key_props") keyProperties?: KeyProperties; /** * Properties of the secret backing a certificate. */ - @projectedName("json", "secret_props") + @encodedName("application/json", "secret_props") secretProperties?: SecretProperties; /** * Properties of the X509 component of a certificate. */ - @projectedName("json", "x509_props") + @encodedName("application/json", "x509_props") x509CertificateProperties?: X509CertificateProperties; /** * Actions that will be performed by Key Vault over the lifetime of a certificate. */ - @projectedName("json", "lifetime_actions") + @encodedName("application/json", "lifetime_actions") lifetimeActions?: LifetimeAction[]; /** * Parameters for the issuer of the X509 component of a certificate. */ - @projectedName("json", "issuer") + @encodedName("application/json", "issuer") issuerParameters?: IssuerParameters; /** @@ -939,25 +939,25 @@ model KeyProperties { /** * The type of key pair to be used for the certificate. */ - @projectedName("json", "kty") + @encodedName("application/json", "kty") keyType?: JsonWebKeyType; /** * The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ - @projectedName("json", "key_size") + @encodedName("application/json", "key_size") keySize?: int32; /** * Indicates if the same key pair will be used on certificate renewal. */ - @projectedName("json", "reuse_key") + @encodedName("application/json", "reuse_key") reuseKey?: boolean; /** * Elliptic curve name. For valid values, see JsonWebKeyCurveName. */ - @projectedName("json", "crv") + @encodedName("application/json", "crv") curve?: JsonWebKeyCurveName; } @@ -988,19 +988,19 @@ model X509CertificateProperties { /** * The subject alternative names. */ - @projectedName("json", "sans") + @encodedName("application/json", "sans") subjectAlternativeNames?: SubjectAlternativeNames; /** * Defines how the certificate's key may be used. */ - @projectedName("json", "key_usage") + @encodedName("application/json", "key_usage") keyUsage?: KeyUsageType[]; /** * The duration that the certificate is valid in months. */ - @projectedName("json", "validity_months") + @encodedName("application/json", "validity_months") validityInMonths?: int32; } @@ -1016,7 +1016,7 @@ model SubjectAlternativeNames { /** * Domain names. */ - @projectedName("json", "dns_names") + @encodedName("application/json", "dns_names") dnsNames?: string[]; /** @@ -1050,7 +1050,7 @@ model Trigger { */ @maxValue(99) @minValue(1) - @projectedName("json", "lifetime_percentage") + @encodedName("application/json", "lifetime_percentage") lifetimePercentage?: int32; /** @@ -1058,7 +1058,7 @@ model Trigger { * validity_in_months multiplied by 27. If validity_in_months is 36, then value * should be between 1 and 972 (36 * 27). */ - @projectedName("json", "days_before_expiry") + @encodedName("application/json", "days_before_expiry") daysBeforeExpiry?: int32; } @@ -1069,7 +1069,7 @@ model Action { /** * The type of the action. */ - @projectedName("json", "action_type") + @encodedName("application/json", "action_type") actionType?: ActionType; } @@ -1087,14 +1087,14 @@ model IssuerParameters { * Certificate type as supported by the provider (optional); for example 'OV-SSL', * 'EV-SSL' */ - @projectedName("json", "cty") + @encodedName("application/json", "cty") certificateType?: string; /** * Indicates if the certificates generated under this policy should be published * to certificate transparency logs. */ - @projectedName("json", "cert_transparency") + @encodedName("application/json", "cert_transparency") certificateTransparency?: boolean; } @@ -1111,7 +1111,7 @@ model Contacts { /** * The contact list for the vault certificates. */ - @projectedName("json", "contacts") + @encodedName("application/json", "contacts") contactList?: Contact[]; } @@ -1122,7 +1122,7 @@ model Contact { /** * Email address. */ - @projectedName("json", "email") + @encodedName("application/json", "email") emailAddress?: string; /** @@ -1173,7 +1173,7 @@ model CertificateIssuerSetParameters { /** * Details of the organization as provided to the issuer. */ - @projectedName("json", "org_details") + @encodedName("application/json", "org_details") organizationDetails?: OrganizationDetails; /** @@ -1189,13 +1189,13 @@ model IssuerCredentials { /** * The user name/account name/account id. */ - @projectedName("json", "account_id") + @encodedName("application/json", "account_id") accountId?: string; /** * The password/secret/account key. */ - @projectedName("json", "pwd") + @encodedName("application/json", "pwd") password?: string; } @@ -1211,7 +1211,7 @@ model OrganizationDetails { /** * Details of the organization administrator. */ - @projectedName("json", "admin_details") + @encodedName("application/json", "admin_details") adminDetails?: AdministratorDetails[]; } @@ -1222,19 +1222,19 @@ model AdministratorDetails { /** * First name. */ - @projectedName("json", "first_name") + @encodedName("application/json", "first_name") firstName?: string; /** * Last name. */ - @projectedName("json", "last_name") + @encodedName("application/json", "last_name") lastName?: string; /** * Email address. */ - @projectedName("json", "email") + @encodedName("application/json", "email") emailAddress?: string; /** @@ -1288,7 +1288,7 @@ model IssuerBundle { /** * Details of the organization as provided to the issuer. */ - @projectedName("json", "org_details") + @encodedName("application/json", "org_details") organizationDetails?: OrganizationDetails; /** @@ -1314,7 +1314,7 @@ model CertificateIssuerUpdateParameters { /** * Details of the organization as provided to the issuer. */ - @projectedName("json", "org_details") + @encodedName("application/json", "org_details") organizationDetails?: OrganizationDetails; /** @@ -1330,13 +1330,13 @@ model CertificateCreateParameters { /** * The management policy for the certificate. */ - @projectedName("json", "policy") + @encodedName("application/json", "policy") certificatePolicy?: CertificatePolicy; /** * The attributes of the certificate (optional). */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") certificateAttributes?: CertificateAttributes; /** @@ -1358,7 +1358,7 @@ model CertificateOperation { /** * Parameters for the issuer of the X509 component of a certificate. */ - @projectedName("json", "issuer") + @encodedName("application/json", "issuer") issuerParameters?: IssuerParameters; /** @@ -1370,7 +1370,7 @@ model CertificateOperation { /** * Indicates if cancellation was requested on the certificate operation. */ - @projectedName("json", "cancellation_requested") + @encodedName("application/json", "cancellation_requested") cancellationRequested?: boolean; /** @@ -1381,7 +1381,7 @@ model CertificateOperation { /** * The status details of the certificate operation. */ - @projectedName("json", "status_details") + @encodedName("application/json", "status_details") statusDetails?: string; /** @@ -1397,7 +1397,7 @@ model CertificateOperation { /** * Identifier for the certificate operation. */ - @projectedName("json", "request_id") + @encodedName("application/json", "request_id") requestId?: string; } @@ -1409,26 +1409,26 @@ model CertificateImportParameters { * Base64 encoded representation of the certificate object to import. This * certificate needs to contain the private key. */ - @projectedName("json", "value") + @encodedName("application/json", "value") base64EncodedCertificate: string; /** * If the private key in base64EncodedCertificate is encrypted, the password used * for encryption. */ - @projectedName("json", "pwd") + @encodedName("application/json", "pwd") password?: string; /** * The management policy for the certificate. */ - @projectedName("json", "policy") + @encodedName("application/json", "policy") certificatePolicy?: CertificatePolicy; /** * The attributes of the certificate (optional). */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") certificateAttributes?: CertificateAttributes; /** @@ -1444,13 +1444,13 @@ model CertificateUpdateParameters { /** * The management policy for the certificate. */ - @projectedName("json", "policy") + @encodedName("application/json", "policy") certificatePolicy?: CertificatePolicy; /** * The attributes of the certificate (optional). */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") certificateAttributes?: CertificateAttributes; /** @@ -1466,7 +1466,7 @@ model CertificateOperationUpdateParameter { /** * Indicates if cancellation was requested on the certificate operation. */ - @projectedName("json", "cancellation_requested") + @encodedName("application/json", "cancellation_requested") cancellationRequested: boolean; } @@ -1477,13 +1477,13 @@ model CertificateMergeParameters { /** * The certificate or the certificate chain to merge. */ - @projectedName("json", "x5c") + @encodedName("application/json", "x5c") x509Certificates: bytes[]; /** * The attributes of the certificate (optional). */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") certificateAttributes?: CertificateAttributes; /** @@ -1510,7 +1510,7 @@ model CertificateRestoreParameters { /** * The backup blob associated with a certificate bundle. */ - @projectedName("json", "value") + @encodedName("application/json", "value") certificateBundleBackup: bytes; } @@ -1554,22 +1554,22 @@ model KeyCreateParameters { /** * The key size in bits. For example: 2048, 3072, or 4096 for RSA. */ - @projectedName("json", "key_size") + @encodedName("application/json", "key_size") keySize?: int32; /** * The public exponent for a RSA key. */ - @projectedName("json", "public_exponent") + @encodedName("application/json", "public_exponent") publicExponent?: int32; - @projectedName("json", "key_ops") + @encodedName("application/json", "key_ops") keyOps?: JsonWebKeyOperation[]; /** * The attributes of a key managed by the key vault service. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") keyAttributes?: KeyAttributes; /** @@ -1580,13 +1580,13 @@ model KeyCreateParameters { /** * Elliptic curve name. For valid values, see JsonWebKeyCurveName. */ - @projectedName("json", "crv") + @encodedName("application/json", "crv") curve?: JsonWebKeyCurveName; /** * The policy rules under which the key can be exported. */ - @projectedName("json", "release_policy") + @encodedName("application/json", "release_policy") releasePolicy?: KeyReleasePolicy; } @@ -1636,7 +1636,7 @@ model KeyReleasePolicy { * Blob encoding the policy rules under which the key can be released. Blob must * be base64 URL encoded. */ - @projectedName("json", "data") + @encodedName("application/json", "data") encodedPolicy?: bytes; } @@ -1669,7 +1669,7 @@ model KeyBundle { /** * The policy rules under which the key can be exported. */ - @projectedName("json", "release_policy") + @encodedName("application/json", "release_policy") releasePolicy?: KeyReleasePolicy; } @@ -1688,7 +1688,7 @@ model JsonWebKey { */ kty?: JsonWebKeyType; - @projectedName("json", "key_ops") + @encodedName("application/json", "key_ops") keyOps?: string[]; /** @@ -1709,19 +1709,19 @@ model JsonWebKey { /** * RSA private key parameter. */ - @projectedName("json", "dp") + @encodedName("application/json", "dp") DP?: bytes; /** * RSA private key parameter. */ - @projectedName("json", "dq") + @encodedName("application/json", "dq") DQ?: bytes; /** * RSA private key parameter. */ - @projectedName("json", "qi") + @encodedName("application/json", "qi") QI?: bytes; /** @@ -1742,7 +1742,7 @@ model JsonWebKey { /** * Protected Key, used with 'Bring Your Own Key'. */ - @projectedName("json", "key_hsm") + @encodedName("application/json", "key_hsm") t?: bytes; /** @@ -1768,7 +1768,7 @@ model KeyImportParameters { /** * Whether to import as a hardware key (HSM) or software key. */ - @projectedName("json", "Hsm") + @encodedName("application/json", "Hsm") hsm?: boolean; /** @@ -1779,7 +1779,7 @@ model KeyImportParameters { /** * The key management attributes. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") keyAttributes?: KeyAttributes; /** @@ -1790,7 +1790,7 @@ model KeyImportParameters { /** * The policy rules under which the key can be exported. */ - @projectedName("json", "release_policy") + @encodedName("application/json", "release_policy") releasePolicy?: KeyReleasePolicy; } @@ -1824,13 +1824,13 @@ model KeyUpdateParameters { * Json web key operations. For more information on possible key operations, see * JsonWebKeyOperation. */ - @projectedName("json", "key_ops") + @encodedName("application/json", "key_ops") keyOps?: JsonWebKeyOperation[]; /** * The attributes of a key managed by the key vault service. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") keyAttributes?: KeyAttributes; /** @@ -1841,7 +1841,7 @@ model KeyUpdateParameters { /** * The policy rules under which the key can be exported. */ - @projectedName("json", "release_policy") + @encodedName("application/json", "release_policy") releasePolicy?: KeyReleasePolicy; } @@ -1895,7 +1895,7 @@ model KeyRestoreParameters { /** * The backup blob associated with a key bundle. */ - @projectedName("json", "value") + @encodedName("application/json", "value") keyBundleBackup: bytes; } @@ -1906,7 +1906,7 @@ model KeyOperationsParameters { /** * algorithm identifier */ - @projectedName("json", "alg") + @encodedName("application/json", "alg") algorithm: JsonWebKeyEncryptionAlgorithm; value: bytes; @@ -1941,18 +1941,18 @@ model KeyOperationResult { kid?: string; @visibility("read") - @projectedName("json", "value") + @encodedName("application/json", "value") result?: bytes; @visibility("read") iv?: bytes; @visibility("read") - @projectedName("json", "tag") + @encodedName("application/json", "tag") authenticationTag?: bytes; @visibility("read") - @projectedName("json", "aad") + @encodedName("application/json", "aad") additionalAuthenticatedData?: bytes; } @@ -1964,7 +1964,7 @@ model KeySignParameters { * The signing/verification algorithm identifier. For more information on possible * algorithm types, see JsonWebKeySignatureAlgorithm. */ - @projectedName("json", "alg") + @encodedName("application/json", "alg") algorithm: JsonWebKeySignatureAlgorithm; value: bytes; @@ -1978,7 +1978,7 @@ model KeyVerifyParameters { * The signing/verification algorithm. For more information on possible algorithm * types, see JsonWebKeySignatureAlgorithm. */ - @projectedName("json", "alg") + @encodedName("application/json", "alg") algorithm: JsonWebKeySignatureAlgorithm; /** @@ -1989,7 +1989,7 @@ model KeyVerifyParameters { /** * The signature to be verified. */ - @projectedName("json", "value") + @encodedName("application/json", "value") signature: bytes; } @@ -2012,7 +2012,7 @@ model KeyReleaseParameters { * The attestation assertion for the target of the key release. */ @minLength(1) - @projectedName("json", "target") + @encodedName("application/json", "target") targetAttestationToken: string; /** @@ -2223,7 +2223,7 @@ model RoleDefinitionProperties { /** * The role type. */ - @projectedName("json", "type") + @encodedName("application/json", "type") roleType?: RoleType; /** @@ -2380,7 +2380,7 @@ model SecretSetParameters { /** * The secret management attributes. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") secretAttributes?: SecretAttributes; } @@ -2484,7 +2484,7 @@ model SecretUpdateParameters { /** * The secret management attributes. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") secretAttributes?: SecretAttributes; /** @@ -2575,7 +2575,7 @@ model SecretRestoreParameters { /** * The backup blob associated with a secret bundle. */ - @projectedName("json", "value") + @encodedName("application/json", "value") secretBundleBackup: bytes; } @@ -2585,7 +2585,7 @@ model SecurityDomainOperationStatus { */ status?: OperationStatus; - @projectedName("json", "status_details") + @encodedName("application/json", "status_details") statusDetails?: string; } @@ -2617,7 +2617,7 @@ model SecurityDomainJsonWebKey { */ kty: string; - @projectedName("json", "key_ops") + @encodedName("application/json", "key_ops") keyOps: string[]; /** @@ -2633,7 +2633,7 @@ model SecurityDomainJsonWebKey { /** * X509 certificate chain parameter */ - @projectedName("json", "x5c") + @encodedName("application/json", "x5c") x5C: string[]; /** @@ -2644,13 +2644,13 @@ model SecurityDomainJsonWebKey { /** * X509 certificate SHA1 thumbprint. This is optional. */ - @projectedName("json", "x5t") + @encodedName("application/json", "x5t") x5T?: string; /** * X509 certificate SHA256 thumbprint. */ - @projectedName("json", "x5t#S256") + @encodedName("application/json", "x5t#S256") x5TS256: string; /** @@ -2673,13 +2673,13 @@ model TransferKey { /** * Specifies the format of the transfer key */ - @projectedName("json", "key_format") + @encodedName("application/json", "key_format") keyFormat?: string = "jwk"; /** * Specifies the transfer key in JWK format */ - @projectedName("json", "transfer_key") + @encodedName("application/json", "transfer_key") transferKey: SecurityDomainJsonWebKey; } @@ -2913,7 +2913,7 @@ model StorageRestoreParameters { /** * The backup blob associated with a storage account. */ - @projectedName("json", "value") + @encodedName("application/json", "value") storageBundleBackup: bytes; } @@ -2944,7 +2944,7 @@ model StorageAccountCreateParameters { /** * The attributes of the storage account. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") storageAccountAttributes?: StorageAccountAttributes; /** @@ -2975,7 +2975,7 @@ model StorageAccountUpdateParameters { /** * The attributes of the storage account. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") storageAccountAttributes?: StorageAccountAttributes; /** @@ -3013,7 +3013,7 @@ model SasDefinitionItem { * The storage account SAS definition secret id. */ @visibility("read") - @projectedName("json", "sid") + @encodedName("application/json", "sid") secretId?: string; /** @@ -3136,7 +3136,7 @@ model SasDefinitionBundle { * Storage account SAS definition secret id. */ @visibility("read") - @projectedName("json", "sid") + @encodedName("application/json", "sid") secretId?: string; /** @@ -3194,7 +3194,7 @@ model SasDefinitionCreateParameters { /** * The attributes of the SAS definition. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") sasDefinitionAttributes?: SasDefinitionAttributes; /** @@ -3226,7 +3226,7 @@ model SasDefinitionUpdateParameters { /** * The attributes of the SAS definition. */ - @projectedName("json", "attributes") + @encodedName("application/json", "attributes") sasDefinitionAttributes?: SasDefinitionAttributes; /** diff --git a/packages/extensions/openapi-to-typespec/test/loadTest/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/loadTest/tsp-output/client.tsp deleted file mode 100644 index 5bfefd1d0..000000000 --- a/packages/extensions/openapi-to-typespec/test/loadTest/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.LoadTesting; diff --git a/packages/extensions/openapi-to-typespec/test/nh/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/nh/tsp-output/client.tsp deleted file mode 100644 index c51f3b7ef..000000000 --- a/packages/extensions/openapi-to-typespec/test/nh/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using NotificationHubsClient; diff --git a/packages/extensions/openapi-to-typespec/test/nh/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/nh/tsp-output/models.tsp index 59e8c27c1..1bbc82322 100644 --- a/packages/extensions/openapi-to-typespec/test/nh/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/nh/tsp-output/models.tsp @@ -126,77 +126,77 @@ model NotificationHubEntryModel { model NotificationHubContentModel { type?: NotificationHubContentModelType; - @projectedName("json", "NotificationHubDescription") + @encodedName("application/json", "NotificationHubDescription") notificationHubDescription?: NotificationHubDescriptionModel; } model NotificationHubDescriptionModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: NotificationHubDescriptionModelXmlnsI; - @projectedName("json", "RegistrationTtl") + @encodedName("application/json", "RegistrationTtl") registrationTtl?: string; - @projectedName("json", "Location") + @encodedName("application/json", "Location") location?: string; - @projectedName("json", "ApnsCredential") + @encodedName("application/json", "ApnsCredential") apnsCredential?: PropertyBagModelItem[]; - @projectedName("json", "GcmCredential") + @encodedName("application/json", "GcmCredential") gcmCredential?: PropertyBagModelItem[]; - @projectedName("json", "WnsCredential") + @encodedName("application/json", "WnsCredential") wnsCredential?: PropertyBagModelItem[]; - @projectedName("json", "AuthorizationRules") + @encodedName("application/json", "AuthorizationRules") authorizationRules?: NotificationHubDescriptionModelAuthorizationRulesItem[]; } model PropertyBagModelItem { - @projectedName("json", "Name") + @encodedName("application/json", "Name") name?: string; - @projectedName("json", "Value") + @encodedName("application/json", "Value") value?: string; } model NotificationHubDescriptionModelAuthorizationRulesItem { - @projectedName("json", "i:type") + @encodedName("application/json", "i:type") iType?: NotificationHubDescriptionModelAuthorizationRulesItemIType; - @projectedName("json", "ClaimType") + @encodedName("application/json", "ClaimType") claimType?: NotificationHubDescriptionModelAuthorizationRulesItemClaimType; - @projectedName("json", "ClaimValue") + @encodedName("application/json", "ClaimValue") claimValue?: string; - @projectedName("json", "Rights") + @encodedName("application/json", "Rights") rights?: string[]; - @projectedName("json", "CreatedTime") + @encodedName("application/json", "CreatedTime") createdTime?: string; - @projectedName("json", "ModifiedTime") + @encodedName("application/json", "ModifiedTime") modifiedTime?: string; - @projectedName("json", "KeyName") + @encodedName("application/json", "KeyName") keyName?: string; - @projectedName("json", "PrimaryKey") + @encodedName("application/json", "PrimaryKey") primaryKey?: string; - @projectedName("json", "SecondaryKey") + @encodedName("application/json", "SecondaryKey") secondaryKey?: string; } model RegistrationEntryModel { content?: NotificationHubContentModel; - @projectedName("json", "xmlns:m") + @encodedName("application/json", "xmlns:m") xmlnsM?: RegistrationEntryModelXmlnsM; - @projectedName("json", "m:etag") + @encodedName("application/json", "m:etag") mEtag?: string; } @@ -309,147 +309,147 @@ model InstallationPatchModelItem { model RegistrationContentModel { type?: RegistrationContentModelType; - @projectedName("json", "AppleRegistrationDescription") + @encodedName("application/json", "AppleRegistrationDescription") appleRegistrationDescription?: AppleRegistrationContentModel; - @projectedName("json", "AppleTemplateRegistrationDescription") + @encodedName("application/json", "AppleTemplateRegistrationDescription") appleTemplateRegistrationDescription?: AppleTemplateRegistrationContentModel; - @projectedName("json", "BaiduRegistrationDescription") + @encodedName("application/json", "BaiduRegistrationDescription") baiduRegistrationDescription?: BaiduRegistrationContentModel; - @projectedName("json", "BaiduTemplateRegistrationDescription") + @encodedName("application/json", "BaiduTemplateRegistrationDescription") baiduTemplateRegistrationDescription?: BaiduTemplateRegistrationContentModel; - @projectedName("json", "GcmRegistrationDescription") + @encodedName("application/json", "GcmRegistrationDescription") gcmRegistrationDescription?: GcmRegistrationContentModel; - @projectedName("json", "GcmTemplateRegistrationDescription") + @encodedName("application/json", "GcmTemplateRegistrationDescription") gcmTemplateRegistrationDescription?: GcmTemplateRegistrationContentModel; - @projectedName("json", "WindowsRegistrationDescription") + @encodedName("application/json", "WindowsRegistrationDescription") windowsRegistrationDescription?: WindowsRegistrationContentModel; - @projectedName("json", "WindowsTemplateRegistrationDescription") + @encodedName("application/json", "WindowsTemplateRegistrationDescription") windowsTemplateRegistrationDescription?: WindowsTemplateRegistrationContentModel; } model AppleRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: AppleRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "DeviceToken") + @encodedName("application/json", "DeviceToken") deviceToken: string; } model AppleTemplateRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: AppleTemplateRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "DeviceToken") + @encodedName("application/json", "DeviceToken") deviceToken: string; - @projectedName("json", "BodyTemplate") + @encodedName("application/json", "BodyTemplate") bodyTemplate: string; - @projectedName("json", "Expiry") + @encodedName("application/json", "Expiry") expiry?: string; } model BaiduRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: BaiduRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "BaiduUserId") + @encodedName("application/json", "BaiduUserId") baiduUserId: string; - @projectedName("json", "BaiduChannelId") + @encodedName("application/json", "BaiduChannelId") baiduChannelId: string; } model BaiduTemplateRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: BaiduTemplateRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "BaiduUserId") + @encodedName("application/json", "BaiduUserId") baiduUserId: string; - @projectedName("json", "BaiduChannelId") + @encodedName("application/json", "BaiduChannelId") baiduChannelId: string; - @projectedName("json", "BodyTemplate") + @encodedName("application/json", "BodyTemplate") bodyTemplate: string; } model GcmRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: GcmRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "GcmRegistrationId") + @encodedName("application/json", "GcmRegistrationId") gcmRegistrationId?: string; } model GcmTemplateRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: GcmTemplateRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "GcmRegistrationId") + @encodedName("application/json", "GcmRegistrationId") gcmRegistrationId: string; - @projectedName("json", "BodyTemplate") + @encodedName("application/json", "BodyTemplate") bodyTemplate: string; } model WindowsRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: WindowsRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "ChannelUri") + @encodedName("application/json", "ChannelUri") channelUri: string; } model WindowsTemplateRegistrationContentModel { - @projectedName("json", "xmlns:i") + @encodedName("application/json", "xmlns:i") xmlnsI?: WindowsTemplateRegistrationContentModelXmlnsI; - @projectedName("json", "Tags") + @encodedName("application/json", "Tags") tags?: string; - @projectedName("json", "ChannelUri") + @encodedName("application/json", "ChannelUri") channelUri: string; - @projectedName("json", "BodyTemplate") + @encodedName("application/json", "BodyTemplate") bodyTemplate: string; - @projectedName("json", "WnsHeaders") + @encodedName("application/json", "WnsHeaders") wnsHeaders?: WindowsTemplateRegistrationContentModelWnsHeadersItem[]; } model WindowsTemplateRegistrationContentModelWnsHeadersItem { - @projectedName("json", "Header") + @encodedName("application/json", "Header") header?: string; - @projectedName("json", "Value") + @encodedName("application/json", "Value") value?: string; } diff --git a/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/client.tsp deleted file mode 100644 index 232662c7b..000000000 --- a/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.AI.OpenAI; diff --git a/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/models.tsp index b109e9289..4b7b60795 100644 --- a/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/openAI/tsp-output/models.tsp @@ -21,7 +21,7 @@ model Paths1Vtxb06DeploymentsDeploymentIdCompletionsPostRequestbodyContentApplic /** * The maximum number of tokens to generate. Has minimum of 0. */ - @projectedName("json", "max_tokens") + @encodedName("application/json", "max_tokens") maxTokens?: int32 = 16; /** @@ -42,7 +42,7 @@ model Paths1Vtxb06DeploymentsDeploymentIdCompletionsPostRequestbodyContentApplic * Minimum of 0 and maximum of 1 allowed. * */ - @projectedName("json", "top_p") + @encodedName("application/json", "top_p") topP?: float32 = 1; /** @@ -57,7 +57,7 @@ model Paths1Vtxb06DeploymentsDeploymentIdCompletionsPostRequestbodyContentApplic * token. As an example, you can pass {"50256" : -100} to prevent the * <|endoftext|> token from being generated. */ - @projectedName("json", "logit_bias") + @encodedName("application/json", "logit_bias") logitBias?: Record; /** @@ -100,14 +100,14 @@ model Paths1Vtxb06DeploymentsDeploymentIdCompletionsPostRequestbodyContentApplic */ stop?: unknown; - @projectedName("json", "completion_config") + @encodedName("application/json", "completion_config") completionConfig?: string; /** * can be used to disable any server-side caching, 0=no cache, 1=prompt prefix * enabled, 2=full cache */ - @projectedName("json", "cache_level") + @encodedName("application/json", "cache_level") cacheLevel?: int32; /** @@ -115,21 +115,21 @@ model Paths1Vtxb06DeploymentsDeploymentIdCompletionsPostRequestbodyContentApplic * so far. Decreases the model's likelihood to repeat the same line verbatim. Has * minimum of -2 and maximum of 2. */ - @projectedName("json", "presence_penalty") + @encodedName("application/json", "presence_penalty") presencePenalty?: float32; /** * How much to penalize new tokens based on whether they appear in the text so * far. Increases the model's likelihood to talk about new topics. */ - @projectedName("json", "frequency_penalty") + @encodedName("application/json", "frequency_penalty") frequencyPenalty?: float32; /** * How many generations to create server side, and display only the best. Will not * stream intermediate progress if best_of > 1. Has maximum value of 128. */ - @projectedName("json", "best_of") + @encodedName("application/json", "best_of") bestOf?: int32; } @@ -146,20 +146,20 @@ model Post200ApplicationJsonPropertiesItemsItem { index?: int32; logprobs?: PostResponses200ContentApplicationJsonSchemaChoicesItemLogprobs; - @projectedName("json", "finish_reason") + @encodedName("application/json", "finish_reason") finishReason?: string; } model PostResponses200ContentApplicationJsonSchemaChoicesItemLogprobs { tokens?: string[]; - @projectedName("json", "token_logprobs") + @encodedName("application/json", "token_logprobs") tokenLogprobs?: float32[]; - @projectedName("json", "top_logprobs") + @encodedName("application/json", "top_logprobs") topLogprobs?: Record[]; - @projectedName("json", "text_offset") + @encodedName("application/json", "text_offset") textOffset?: int32[]; } @@ -191,7 +191,7 @@ model Paths13PiqocDeploymentsDeploymentIdEmbeddingsPostRequestbodyContentApplica /** * input type of embedding search to use */ - @projectedName("json", "input_type") + @encodedName("application/json", "input_type") inputType?: string; /** diff --git a/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/client.tsp deleted file mode 100644 index 10d4dd4bc..000000000 --- a/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using AutoRestPagingTestService; diff --git a/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/models.tsp index 122307deb..82013070c 100644 --- a/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/pagination/tsp-output/models.tsp @@ -51,14 +51,14 @@ model OdataProductResult { values?: Product[]; @nextLink - @projectedName("json", "odata.nextLink") + @encodedName("application/json", "odata.nextLink") odataNextLink?: string; } @pagedResult model ProductResultValueWithXMSClientName { @items - @projectedName("json", "values") + @encodedName("application/json", "values") indexes?: Product[]; @nextLink diff --git a/packages/extensions/openapi-to-typespec/test/qna/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/qna/tsp-output/client.tsp deleted file mode 100644 index 5681d148d..000000000 --- a/packages/extensions/openapi-to-typespec/test/qna/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using Azure.Language.QnAMaker; diff --git a/packages/extensions/openapi-to-typespec/test/qna/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/qna/tsp-output/models.tsp index a8a2a8e80..8eb481aae 100644 --- a/packages/extensions/openapi-to-typespec/test/qna/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/qna/tsp-output/models.tsp @@ -131,19 +131,19 @@ model AnswersOptions { * Minimum threshold score for answers, value ranges from 0 to 1. */ @maxValue(1) - @projectedName("json", "confidenceScoreThreshold") + @encodedName("application/json", "confidenceScoreThreshold") confidenceThreshold?: float64; /** * Context object with previous QnA's information. */ - @projectedName("json", "context") + @encodedName("application/json", "context") answerContext?: KnowledgeBaseAnswerContext; /** * Type of ranker to be used. */ - @projectedName("json", "rankerType") + @encodedName("application/json", "rankerType") rankerKind?: RankerKind; /** @@ -154,7 +154,7 @@ model AnswersOptions { /** * To configure Answer span prediction feature. */ - @projectedName("json", "answerSpanRequest") + @encodedName("application/json", "answerSpanRequest") shortAnswerOptions?: ShortAnswerOptions; /** @@ -175,7 +175,7 @@ model KnowledgeBaseAnswerContext { /** * Previous user query. */ - @projectedName("json", "previousUserQuery") + @encodedName("application/json", "previousUserQuery") previousQuestion?: string; } @@ -241,7 +241,7 @@ model ShortAnswerOptions { * to 1. */ @maxValue(1) - @projectedName("json", "confidenceScoreThreshold") + @encodedName("application/json", "confidenceScoreThreshold") confidenceThreshold?: float64; /** @@ -249,7 +249,7 @@ model ShortAnswerOptions { */ @maxValue(10) @minValue(1) - @projectedName("json", "topAnswersWithSpan") + @encodedName("application/json", "topAnswersWithSpan") top?: int32; } @@ -281,13 +281,13 @@ model KnowledgeBaseAnswer { * Answer confidence score, value ranges from 0 to 1. */ @maxValue(1) - @projectedName("json", "confidenceScore") + @encodedName("application/json", "confidenceScore") confidence?: float64; /** * ID of the QnA result. */ - @projectedName("json", "id") + @encodedName("application/json", "id") qnaId?: int32; /** @@ -309,7 +309,7 @@ model KnowledgeBaseAnswer { /** * Answer span object of QnA with respect to user's question. */ - @projectedName("json", "answerSpan") + @encodedName("application/json", "answerSpan") shortAnswer?: AnswerSpan; } @@ -364,7 +364,7 @@ model AnswerSpan { * Predicted score of answer span, value ranges from 0 to 1. */ @maxValue(1) - @projectedName("json", "confidenceScore") + @encodedName("application/json", "confidenceScore") confidence?: float64; /** @@ -465,7 +465,7 @@ model AnswersFromTextOptions { /** * Text records to be searched for given question. */ - @projectedName("json", "records") + @encodedName("application/json", "records") textDocuments: TextDocument[]; /** @@ -521,7 +521,7 @@ model TextAnswer { * answer confidence score, value ranges from 0 to 1. */ @maxValue(1) - @projectedName("json", "confidenceScore") + @encodedName("application/json", "confidenceScore") confidence?: float64; /** @@ -532,7 +532,7 @@ model TextAnswer { /** * Answer span object with respect to user's question. */ - @projectedName("json", "answerSpan") + @encodedName("application/json", "answerSpan") shortAnswer?: AnswerSpan; /** diff --git a/packages/extensions/openapi-to-typespec/test/qnaAuthoring/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/qnaAuthoring/tsp-output/client.tsp deleted file mode 100644 index dfa3ffa39..000000000 --- a/packages/extensions/openapi-to-typespec/test/qnaAuthoring/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using MicrosoftCognitiveLanguageServiceQuestionAnsweringAuthoring; diff --git a/packages/extensions/openapi-to-typespec/test/qnaRuntime/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/qnaRuntime/tsp-output/client.tsp deleted file mode 100644 index d8e2a79e5..000000000 --- a/packages/extensions/openapi-to-typespec/test/qnaRuntime/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using QnAMakerRuntimeClient; diff --git a/packages/extensions/openapi-to-typespec/test/schemaRegistry/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/schemaRegistry/tsp-output/client.tsp deleted file mode 100644 index 5d230eb04..000000000 --- a/packages/extensions/openapi-to-typespec/test/schemaRegistry/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using AzureSchemaRegistry; diff --git a/packages/extensions/openapi-to-typespec/test/url/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/url/tsp-output/client.tsp deleted file mode 100644 index 7c7e7f334..000000000 --- a/packages/extensions/openapi-to-typespec/test/url/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using AutoRestUrlTestService; diff --git a/packages/extensions/openapi-to-typespec/test/webpubsub/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/webpubsub/tsp-output/client.tsp deleted file mode 100644 index fde21520d..000000000 --- a/packages/extensions/openapi-to-typespec/test/webpubsub/tsp-output/client.tsp +++ /dev/null @@ -1,3 +0,0 @@ -import "./main.tsp"; - -using AzureWebPubSubServiceRESTAPI;