-
Notifications
You must be signed in to change notification settings - Fork 101
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
Specifying multiple protocols doesn't work #165
Comments
That doesn't look right. @sebastianhaas how are you producing the swagger though, I'm not sure that I've seen the component-explorer path produced in a swagger file before... |
I'm not sure if that was your question, but I just navigated to |
@sebastianhaas, can you for the loopback-sandbox and write the steps to reproduce in the readme? Thanks in advance. |
@richardpringle Hope that works for you! |
@sebastianhaas, there's definitely something wrong here... but I'm not sure that fixing the extra set of brackets addresses much. What are you doing with the I'm not sure that the schemes there are entirely relevant to your API in general... In any case, there should not be an extra set of brackets, so if you want to make the fix, I will try to make sure that the PR gets landed. |
I wasn't aware of the API definition generator. However, I don't really see how this matters in regard to the bug I reported. I tried using it, it seems to be broken anyway. I'm using |
I don't believe that "schemes" is doing anything in the context of the explorer. It's not taking into consideration the scheme of the API itself, it's just being set based on the component-explorer configuration. Even though the swagger.json is "mostly" working for you, that's not the recommended way of grabbing the specification for your API. I think there might be some flaws that you run into if your API gets more complex. What was broken with the |
That might be true, but I wouldn't bet on it. The explorer is using the swagger file itself to determine the endpoints etc., so I suspect the protocol does matter. Just for the sake of completeness, the actual swagger scheme is built in
What would the recommended way be? |
@superkhau how can this not be an issue? Afaik there is no way to specify protocols for API definition files, so using loopback:api-def-generator always includes post processing which is needlessly annoying. Just allow passing options in at https://github.com/strongloop/loopback-api-definition/blob/master/lib/get-api-def.js#L23 so we can at least specify one protocol + host properly. |
@sebastianhaas I purposely removed the bug label so someone can take over and confirm the bug and take over where @richardpringle left off as he is not at IBM anymore. "unlabeled" lets us know someone needs to look at this -- when someone decides to take this issue on, you will see the "triage" label applied at that time. That said, after reading your discussion above. It sounds like a bug -- array of strings for protocol looks correct and matching the swagger spec you linked above. Just need someone to slap a bug label on it after cloning your provided repo to confirm. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think this is still an issue that needs to be addressed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still open and important. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Specifying multiple protocols for
loopback-component-explorer
likeresults in an invalid
swagger.json
:I doubt this behaviour is intended because of https://github.com/strongloop/loopback-swagger/blob/master/lib/specgen/swagger-spec-generator.js#L130 as well as swagger-api/swagger-ui#1006.
Also see http://swagger.io/specification/, section Schema states that field
schemes
is an array of strings.I will create a PR to fix it if it is confirmed as a bug.
The text was updated successfully, but these errors were encountered: