diff --git a/.chronus/changes/update_canonical_swagger_folder_name-2024-6-6-11-44-3.md b/.chronus/changes/update_canonical_swagger_folder_name-2024-6-6-11-44-3.md new file mode 100644 index 0000000000..14101dc92c --- /dev/null +++ b/.chronus/changes/update_canonical_swagger_folder_name-2024-6-6-11-44-3.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@azure-tools/typespec-autorest-canonical" +--- + +update the canonical swagger file folder name diff --git a/docs/emitters/typespec-autorest-canonical/reference/emitter.md b/docs/emitters/typespec-autorest-canonical/reference/emitter.md index 4613b5348f..820c8a8995 100644 --- a/docs/emitters/typespec-autorest-canonical/reference/emitter.md +++ b/docs/emitters/typespec-autorest-canonical/reference/emitter.md @@ -33,7 +33,7 @@ Output file will interpolate the following values: - service-name: Name of the service if multiple - azure-resource-provider-folder: Value of the azure-resource-provider-folder option -Default: `{azure-resource-provider-folder}/{service-name}/{version}/openapi.json` +Default: `{azure-resource-provider-folder}/{service-name}/canonical/openapi.json` Example: Single service diff --git a/eng/feeds/arm-canonical/tspconfig.yaml b/eng/feeds/arm-canonical/tspconfig.yaml index 3e0f896eda..e75f83fbd5 100644 --- a/eng/feeds/arm-canonical/tspconfig.yaml +++ b/eng/feeds/arm-canonical/tspconfig.yaml @@ -11,7 +11,7 @@ options: '@azure-tools/typespec-autorest-canonical': emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" - output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" + output-file: "{azure-resource-provider-folder}/{service-name}/canonical/openapi.json" linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/typespec-autorest-canonical/README.md b/packages/typespec-autorest-canonical/README.md index b11edfc352..1eacd104bf 100644 --- a/packages/typespec-autorest-canonical/README.md +++ b/packages/typespec-autorest-canonical/README.md @@ -37,7 +37,7 @@ Output file will interpolate the following values: - service-name: Name of the service if multiple - azure-resource-provider-folder: Value of the azure-resource-provider-folder option -Default: `{azure-resource-provider-folder}/{service-name}/{version}/openapi.json` +Default: `{azure-resource-provider-folder}/{service-name}/canonical/openapi.json` Example: Single service diff --git a/packages/typespec-autorest-canonical/src/emitter.ts b/packages/typespec-autorest-canonical/src/emitter.ts index 0b36e004f5..e4919b12b6 100644 --- a/packages/typespec-autorest-canonical/src/emitter.ts +++ b/packages/typespec-autorest-canonical/src/emitter.ts @@ -134,8 +134,7 @@ async function emitAllServices( function resolveOutputFile( service: Service, multipleServices: boolean, - options: ResolvedAutorestCanonicalEmitterOptions, - version?: string + options: ResolvedAutorestCanonicalEmitterOptions ): string { const azureResourceProviderFolder = options.azureResourceProviderFolder; const interpolated = interpolatePath(options.outputFile, { @@ -144,12 +143,6 @@ function resolveOutputFile( multipleServices || azureResourceProviderFolder ? getNamespaceFullName(service.type) : undefined, - "version-status": azureResourceProviderFolder - ? version?.includes("preview") - ? "preview" - : "stable" - : undefined, - version, }); return resolvePath(options.outputDir, interpolated); diff --git a/packages/typespec-autorest-canonical/src/lib.ts b/packages/typespec-autorest-canonical/src/lib.ts index 92dc95e549..0122ea8e62 100644 --- a/packages/typespec-autorest-canonical/src/lib.ts +++ b/packages/typespec-autorest-canonical/src/lib.ts @@ -8,7 +8,7 @@ export interface AutorestCanonicalEmitterOptions { * - version: Version of the service if multiple * - azure-resource-provider-folder: Value of the azure-resource-provider-folder option * - * @default `{azure-resource-provider-folder}/{service-name}/{version}/openapi.json` + * @default `{azure-resource-provider-folder}/{service-name}/canonical/openapi.json` * * * @example Single service no versioning @@ -68,7 +68,7 @@ const EmitterOptionsSchema: JSONSchemaType = { " - service-name: Name of the service if multiple", " - azure-resource-provider-folder: Value of the azure-resource-provider-folder option", "", - "Default: `{azure-resource-provider-folder}/{service-name}/{version}/openapi.json`", + "Default: `{azure-resource-provider-folder}/{service-name}/canonical/openapi.json`", "", "", "Example: Single service",