Skip to content

@W-17701650@ Add support for OAS#228

Merged
vcua-mobify merged 12 commits intomainfrom
oas-support
May 23, 2025
Merged

@W-17701650@ Add support for OAS#228
vcua-mobify merged 12 commits intomainfrom
oas-support

Conversation

@vcua-mobify
Copy link
Contributor

This PR introduces support for OAS templates by:

  • Introducing openapi-generator to facilitate SDK generation from OAS as well as template initialization
  • Introducing oasdiff to handle checking for API spec changes
  • Updates to the download command so that it is able to download either OAS or RAML files

Notes:
This is not intended to be a breaking change. All raml facilities will continue to work as-is.

The lint command is out of scope for this change. raml-toolkit lint will only support RAML files.

@vcua-mobify vcua-mobify requested a review from a team as a code owner May 15, 2025 20:54
Copy link
Collaborator

@unandyala unandyala left a comment

Choose a reason for hiding this comment

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

The way I am understanding is..
we really need only the exchangeDownloader. Other tools are only wrappers around the openapi tools

Why do we need the wrapper?
Why can't we directly call the open api command? This seems to be an unnecessary additional layer.

My suggestion is...we should directly call open api tools in the SDKs and just use the downloader from raml toolkit. This way it is easier to deprecate the raml-toolkit in future

unandyala
unandyala previously approved these changes May 21, 2025
Copy link
Collaborator

@unandyala unandyala left a comment

Choose a reason for hiding this comment

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

Left few minor comments


// Not all API files in anypoint exchange have an associated fat-as classifier. so
// we return null here for those cases
if (!found) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure of the impact of this. Does it make sense to add a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because we run the same getFileByClassifier for both oas and raml files: https://github.com/SalesforceCommerceCloud/raml-toolkit/blob/oas-support/src/download/exchangeDownloader.ts#L160

But for the raml files up on anypoint exchange, they won't have a fat-oas so we early exit rather than trying to read properties from null.

unandyala
unandyala previously approved these changes May 22, 2025
README.md Outdated

#### `raml-toolkit diff BASE NEW -s oas`

**Note:** This command requires that oasdiff is. installed. Install oasdiff according to https://github.com/oasdiff/oasdiff#installation
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Let's move this to the top of the file to make it more visible before users run into an error trying to using oas

@alexvuong
Copy link
Contributor

Tested these changes locally with commerce-sdk-isomorphic. Confirmed I can the new oas is running as expected

alexvuong
alexvuong previously approved these changes May 22, 2025
@vcua-mobify vcua-mobify dismissed stale reviews from alexvuong and unandyala via 642c2e8 May 23, 2025 18:30
@vcua-mobify vcua-mobify merged commit 7b21bc0 into main May 23, 2025
7 checks passed
@vcua-mobify vcua-mobify deleted the oas-support branch May 23, 2025 21:12
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