-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added SWAGGER_FILE env var #2072
Conversation
Updated README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change request.
The rest are LGTM
docker-run.sh
Outdated
## Adding env var support for swagger json | ||
if [[ -f $SWAGGER_JSON ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use SWAGGER_FILE
or DEFAULT_FILE
instead since it's working with both json
and yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 675812c
Updated readme
index.html
Outdated
@@ -51,6 +51,7 @@ | |||
window.onload = function() { | |||
// Build a system | |||
const editor = SwaggerEditorBundle({ | |||
url: "https://petstore.swagger.io/v2/swagger.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change necessary? I'd like to avoid loading a url
by default, since we have our own methods of providing a default value in the Editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
petstore example is what I see by default whenever I start the swagger editor. I have seen the default json included with the source code, to be petstore. If url
is not a required attrib, you can kindly skip it. I am outside rn, and wont be able to change the source code. Feel free to edit them for me pls
(LGTM besides my review question!) |
Any chance we can merge this? |
Can we get this merged please |
Hi, |
@tim-lai, it looks like the merge commit f93e1ea into master contains an error.
So, the following block in the docker-run.sh is useless:
|
Added support for
SWAGGER_FILE
in docker images of swagger-editor.Description
Earlier it wasn't possible to use a local
json
oryaml
swagger schema file to be used inside docker via env vars. Issue #1695 describes this in details. This is the PR that fixes it.Motivation and Context
Fixes #1695
How Has This Been Tested?
seems to load correct
yaml
definition that only exists on my local machine in current dir.Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests