Apidog · Arazzo Workflow

Apidog Promote Spec Between Branches

Version 1.0.0

Export a spec from one sprint branch and import it into another branch of the same project.

1 workflow 1 source API 1 provider
View Spec View on GitHub AI CodingAPI DesignAPI LifecycleAPI TestingCollaborationDesign-FirstDocumentationMCPMockingPlatformArazzoWorkflows

Provider

apidog

Workflows

promote-spec-between-branches
Promote a specification from one sprint branch to another in the same project.
Exports the API specification from the source branch, then imports it into the target branch of the same project.
2 steps inputs: accessToken, apiVersion, projectId, sourceBranchId, targetBranchId outputs: endpointsCreated, success
1
exportSourceBranch
exportOpenApiData
Export the API specification from the source sprint branch as an OpenAPI 3.0 JSON document.
2
importTargetBranch
importOpenApiData
Import the exported document into the target sprint branch, auto-merging endpoints that already exist there.

Source API Descriptions

Arazzo Workflow Specification

apidog-promote-spec-between-branches-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Apidog Promote Spec Between Branches
  summary: Export a spec from one sprint branch and import it into another branch of the same project.
  description: >-
    Promotes API specification changes from one Apidog sprint branch to another
    within the same project. The source branch is exported as an OpenAPI
    document and that document is imported into the target branch. 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: promote-spec-between-branches
  summary: Promote a specification from one sprint branch to another in the same project.
  description: >-
    Exports the API specification from the source branch, then imports it into
    the target branch of the same project.
  inputs:
    type: object
    required:
    - accessToken
    - apiVersion
    - projectId
    - sourceBranchId
    - targetBranchId
    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 project ID that contains both branches.
      sourceBranchId:
        type: integer
        description: The sprint branch ID to export the specification from.
      targetBranchId:
        type: integer
        description: The sprint branch ID to import the specification into.
  steps:
  - stepId: exportSourceBranch
    description: >-
      Export the API specification from the source sprint branch as an OpenAPI
      3.0 JSON document.
    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: '3.0'
        exportFormat: JSON
        branchId: $inputs.sourceBranchId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      branchDocument: $response.body#/data
  - stepId: importTargetBranch
    description: >-
      Import the exported document into the target sprint branch, auto-merging
      endpoints that already exist there.
    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: $steps.exportSourceBranch.outputs.branchDocument
        options:
          endpointOverwriteBehavior: AUTO_MERGE
          schemaOverwriteBehavior: AUTO_MERGE
          targetBranchId: $inputs.targetBranchId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      success: $response.body#/success
      endpointsCreated: $response.body#/data/endpoint/created
  outputs:
    success: $steps.importTargetBranch.outputs.success
    endpointsCreated: $steps.importTargetBranch.outputs.endpointsCreated