File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 5858 sorter : "alpha"
5959 } ) ;
6060
61+ function addApiKeyAuthorization ( ) {
62+ var key = $ ( '#input_apiKey' ) [ 0 ] . value ;
63+ log ( "key: " + key ) ;
64+ if ( key && key . trim ( ) != "" ) {
65+ log ( "added key " + key ) ;
66+ window . authorizations . add ( "key" , new ApiKeyAuthorization ( "api_key" , key , "query" ) ) ;
67+ }
68+ }
69+
6170 $ ( '#input_apiKey' ) . change ( function ( ) {
62- var key = $ ( '#input_apiKey' ) [ 0 ] . value ;
63- log ( "key: " + key ) ;
64- if ( key && key . trim ( ) != "" ) {
65- log ( "added key " + key ) ;
66- window . authorizations . add ( "key" , new ApiKeyAuthorization ( "api_key" , key , "query" ) ) ;
67- }
68- } )
71+ addApiKeyAuthorization ( ) ;
72+ } ) ;
73+
74+ // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
75+ /*
76+ var apiKey = "myApiKeyXXXX123456789";
77+ $('#input_apiKey').val(apiKey);
78+ addApiKeyAuthorization();
79+ */
80+
6981 window . swaggerUi . load ( ) ;
7082 } ) ;
7183 </ script >
You can’t perform that action at this time.
0 commit comments