Skip to content

Support parsing of Arazzo definitions#808

Merged
paulRbr merged 7 commits intobump-sh:mainfrom
paulRbr:arazzo-deployment
Mar 18, 2026
Merged

Support parsing of Arazzo definitions#808
paulRbr merged 7 commits intobump-sh:mainfrom
paulRbr:arazzo-deployment

Conversation

@paulRbr
Copy link
Copy Markdown
Member

@paulRbr paulRbr commented Mar 18, 2026

This PR is dedicated to Arazzo parsing in the current API class
(which name is incorrect and should be renamed Definition in a later
PR...).

It's a combination of multiples commits which should be reviewable
individually, but they stand as a whole. That's why I opened a PR with
all the commits.

Mainly the PR does:

  • Support Arazzo definition in the API class, allowing to do
    API.load(arazzoFile) with errors
  • Quite a few refactos in this API (definition.ts) class to make
    improve the intent of some private functions
  • Extract arazzo's sourceDescriptions when extracting an Arazzo
    typed definition.

Once this is merged, and the bump.sh workflow deploy API is changed to
accept a list of references (the source descriptions), we will be able to change the API client layer:

modified   src/api/models.ts
@@ -82,6 +82,9 @@ export interface DiffItem {
 
 export interface WorkflowVersionRequest {
   definition: string // workflowDefinition
+  references?: Reference[] // List of API references attached to the
+                           // workflow (source descriptions in Arazzo
+                           // vocabulary)
 }
 
 export interface WorkflowVersionResponse {
modified   src/core/workflow-deploy.ts
@@ -50,9 +50,9 @@ export class WorkflowDeploy {
   ): Promise<WorkflowVersionResponse | undefined> {
     let version: WorkflowVersionResponse | undefined
 
-    const request: WorkflowVersionRequest = {
-      definition: workflowDefinition.rawDefinition,
-    }
+    const [definition, references] = await workflowDefinition.extractDefinition()
+
+    const request: WorkflowVersionRequest = {definition, references}
 
     // eslint-disable-next-line prefer-const
     version = await this.createWorkflowVersion(mcpServer, request, token)

paulRbr added 5 commits March 18, 2026 16:31
This commit is a refacto, it doesn't change any existing behavior.

- It renames a type `SpecSchema` to `JSONSchema` (for code clarity)
- It types the result of the Refs parser lib method `$refs.values()`
  early to avoid having to force types later (was previously done in
  the resolveContent method)
- Renames `resolveContent` method to `_resolveContentFrom` and make it
  private
- Don't assign the API references (`this.references`) inside the
  `_resolveContentFrom` method, instead return them so the constructor
  has the responsabiy to do all the instance assignations.

Sorry the commit might not be very readable (due to the linting moving
the private method to the bottom) but the tests pass ✓
Code readability and make it private
This is a small refacto to make the internal
API#_resolveRelativeLocation function accept a relative path as input.

Until now, we would only process absolute paths/URLs, but now we also
process relative path given as input to make sure we build a relative
path (relative to the current definition location `this.location`).

For now this is not used, but will be useful to resolve Arazzo source
descriptions.
@paulRbr paulRbr force-pushed the arazzo-deployment branch from 56659c9 to bdcc2c4 Compare March 18, 2026 15:31
Copy link
Copy Markdown
Contributor

@fbraure fbraure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@paulRbr paulRbr force-pushed the arazzo-deployment branch 2 times, most recently from f8837bc to 9b3b25e Compare March 18, 2026 21:07
paulRbr added 2 commits March 18, 2026 22:21
This commit adapts the `API` class extractor
function (`extractDefinition`) to be able to extract Arazzo
definition's `sourceDescription` (for now only extraction source
descriptions of type `openapi`). Those OpenAPI sources are extracted
to read their content (and we ignore external references of those for
now), and build a list of `references` on the original Arazzo
Definition.

Those references will be used to send the data during a Workflow
deploy on the bump.sh API.
@paulRbr paulRbr force-pushed the arazzo-deployment branch from 9b3b25e to aab4ddc Compare March 18, 2026 21:21
@paulRbr paulRbr merged commit e05330e into bump-sh:main Mar 18, 2026
9 checks passed
@paulRbr paulRbr deleted the arazzo-deployment branch March 18, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants