Support parsing of Arazzo definitions#808
Merged
paulRbr merged 7 commits intobump-sh:mainfrom Mar 18, 2026
Merged
Conversation
fbraure
reviewed
Mar 18, 2026
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.
56659c9 to
bdcc2c4
Compare
f8837bc to
9b3b25e
Compare
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.
9b3b25e to
aab4ddc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is dedicated to Arazzo parsing in the current
APIclass(which name is incorrect and should be renamed
Definitionin a laterPR...).
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:
APIclass, allowing to doAPI.load(arazzoFile)with errorsAPI(definition.ts) class to makeimprove the intent of some private functions
sourceDescriptionswhen extracting an Arazzotyped 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: