Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update postProcess config to allow alternate save mechanism #91

Merged
merged 7 commits into from
Sep 15, 2020

Conversation

danielsharvey
Copy link
Collaborator

@danielsharvey danielsharvey commented Sep 12, 2020

A new saveSwagger() configuration function allows an alternate
mechanism for saving the generated Swagger to be specified, rather
than the standard writing a file to the filesystem.

Update postProcess configuration to run after tag clean-up phase
to allow an alternate mechanism for saving the generated Swagger to
be specified, rather than the standard writing a file to the filesystem.

Allow swaggerJsonPath to be empty/null/undefined, in which case
no file write attempted.

This supports deployment to environments that do not allow writing to the
filesystem e.g. store in memory or database.

A new `saveSwagger()` configuration function allows an alternate
mechanism for saving the generated Swagger to be specified, rather
than the standard writing a file to the filesystem.
@danielsharvey
Copy link
Collaborator Author

danielsharvey commented Sep 12, 2020

@theoomoregbee
Copy link
Owner

just fixed the Travis CI bug: https://travis-ci.community/t/github-pr-is-being-built-but-result-is-not-shown/7025/2

restarted the build to see if it will show up here

Copy link
Owner

@theoomoregbee theoomoregbee left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Owner

@theoomoregbee theoomoregbee left a comment

Choose a reason for hiding this comment

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

since no big difference between this and postProcess method, what about we lean towards encouraging the use of that and keep the ignore saving to local storage when swaggerJsonPath is not truthy

@danielsharvey
Copy link
Collaborator Author

Let’s go that way. I could not make up my mind given the small amount of post-processing (tag clean-up) that currently happens after postProcess is called.

I had originally left tag cleanup after postProcess to allow that method to reference tags before cleanup occurs. If we utilise postProcess it probably makes sense to move cleanup before it is called to ensure consistency between between the two save methods.

Update `postProcess` configuration to run after tag clean-up phase
to allow an alternate mechanism for saving the generated Swagger to
be specified, rather than the standard writing a file to the filesystem.

Allow `swaggerJsonPath` to be empty/null/undefined, in which case
no file write attempted.
@danielsharvey danielsharvey changed the title feat: New saveSwagger config allows an alternate mechanism for saving feat: Update postProcess config to allow alternate save mechanism Sep 15, 2020
@danielsharvey danielsharvey merged commit 3a6b1bc into master Sep 15, 2020
@danielsharvey danielsharvey deleted the alternate-save-swagger branch September 15, 2020 10:55
@theoomoregbee
Copy link
Owner

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants