arazzo: 1.0.1 info: title: Apidog Downgrade OpenAPI Version summary: Import a modern OpenAPI spec into a project and re-export it at an older OpenAPI version. description: >- Uses Apidog to translate an OpenAPI 3.1 specification down to an older OpenAPI version for consumers that cannot parse newer documents. The spec is imported into a staging project and then exported at the requested target version. Each step spells out its request inline — including the required Apidog API version header and bearer authentication — so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: apidogApi url: ../openapi/apidog-apidog-openapi.yml type: openapi workflows: - workflowId: downgrade-oas-version summary: Import an OpenAPI spec and export it at a lower OpenAPI version. description: >- Imports the supplied specification into the staging project, then exports the project at the requested lower OpenAPI version and format. inputs: type: object required: - accessToken - apiVersion - projectId - openapiInput - targetOasVersion properties: accessToken: type: string description: Apidog personal API access token used as the Bearer Token. apiVersion: type: string description: The Apidog API version header value (e.g. 2024-03-28). projectId: type: integer description: The staging project ID to import into and export from. openapiInput: type: string description: The source OpenAPI specification as a JSON or YAML string. targetOasVersion: type: string description: The OpenAPI version to downgrade the export to. enum: - '2.0' - '3.0' exportFormat: type: string description: Output format of the exported document. enum: - JSON - YAML default: YAML steps: - stepId: importSpec description: >- Import the source specification into the staging project, overwriting any existing endpoints so the export reflects exactly this document. operationId: importOpenApiData parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: X-Apidog-Api-Version in: header value: $inputs.apiVersion - name: projectId in: path value: $inputs.projectId requestBody: contentType: application/json payload: input: $inputs.openapiInput options: endpointOverwriteBehavior: OVERWRITE_EXISTING schemaOverwriteBehavior: OVERWRITE_EXISTING successCriteria: - condition: $statusCode == 200 outputs: importSuccess: $response.body#/success - stepId: exportDowngraded description: >- Export the project at the requested lower OpenAPI version and format. operationId: exportOpenApiData parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: X-Apidog-Api-Version in: header value: $inputs.apiVersion - name: projectId in: path value: $inputs.projectId requestBody: contentType: application/json payload: scope: ALL oasVersion: $inputs.targetOasVersion exportFormat: $inputs.exportFormat successCriteria: - condition: $statusCode == 200 outputs: downgradedDocument: $response.body#/data outputs: importSuccess: $steps.importSpec.outputs.importSuccess downgradedDocument: $steps.exportDowngraded.outputs.downgradedDocument