-
Notifications
You must be signed in to change notification settings - Fork 42
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
uiConfig cant handle functions #25
Comments
You should be able to pass the configuration through uiConfig. |
Tried passing the following to uiConfig but it doesn't work:
Am I passing it incorrectly? I ended up adding some custom code to achieve this in swagger-initializer.js though as a workaround. |
I don't think |
The issue is that the uiConfig is serialized to json and supplied by a rest-call. And functions cant be serialized. So we have to find a way to provide the functions in a javascript file or somehow differently... |
Prerequisites
Issue
Hello!
Firstly, thanks for an awesome package! Such a huge help.
I got a question and I am hoping you can help me out on this. I am not quite sure but it seems that preauthorizeBasic and preauthorizeApiKey instance methods as documented in https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md are not yet supported by the package.
Are these options something that you plan to support in the future? If I overlooked it and that they're already supported, can you please provide an example on how I can pass them?
In swagger-ui-express, I am able to utilize the onComplete parameter to pass a function that invokes those instance methods as shown below:
{
tagsSorter: 'alpha',
onComplete: function () {
ui.preauthorizeBasic("basicAuth", "user", "pass");
ui.preauthorizeApiKey("apiKey", "apikey");
}
}
Thanks for the feedback in advance!
The text was updated successfully, but these errors were encountered: