This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Regenerate Client Against OCAPI Version 20.4#37
Merged
Conversation
kevinxh
reviewed
Jul 21, 2020
Contributor
kevinxh
left a comment
There was a problem hiding this comment.
NICE!! Would it make sense to add the generation process to README?
Contributor
Author
The process to regenerate isn't THAT straight forward. So I'd like to avoid that for now. I don't think there is going to be much work on this project in the future. But we we do decide to put more effort into it, then yes that is a good idea. (Note: I don't think salesforce themselves are going to be coming out with too many new versions of ocapi as their are going to be using their new offering) |
kevinxh
approved these changes
Jul 21, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This PR regenerates the client based on the latest release of Salesforce's OCAPI swagger definition (version 20.4). In an attempt to make this process more palatable for future version bumps, I have made changes to linking rules and compilation tools so we don't have to manually intervene in the future as much.
JIRA: WEB-2759
Changes
swagger.jsonfile.transform-class-propertiesbabel plugin to handle class properties (that is how the api's and models are generated, in the past we manually move those properties into the constructors)transform-class-propertiesGeneral Approach to Doing Upgrade
swagger-codegengenerate a new client with the following command 👉swagger-codegen generate -c conf.json -i swagger.json -l javascript --model-package models -o newnew/src/modelsfolder and overwrite the existing ones.new/src/apifolder. Also bring over the newindex.jsfile and make sure that you update the named export to be the default export.npm run copyright:fixnpm run lint:fixYou'll have to manually fix some errors mentioned above.npm run docsHow to test this PR?
npm cinpm run test// All tests should passAlternatively you can run the Scaffold by first:
npm run lerna -- add commercecloud-ocapi-client@0.1.13-release-candidate.0 --scope=@mobify/commerce-integrationsMOBIFY_CONNECTOR_NAME=sfcc npm run startTODO
0.1.12as the package bumping happens when merging into master.