File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const defaultOptions = Object.freeze({
99 spec : { } ,
1010 url : "" ,
1111 urls : null ,
12+ configUrl : null ,
1213 layout : "BaseLayout" ,
1314 docExpansion : "list" ,
1415 maxDisplayedTags : - 1 ,
Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ const optionsFromQuery = () => (options) => {
1313 const urlSearchParams = options . queryConfigEnabled ? parseSearch ( ) : { }
1414
1515 return Object . entries ( urlSearchParams ) . reduce ( ( acc , [ key , value ] ) => {
16- if ( key === "urls.primaryName" ) {
16+ // TODO([email protected] ): drop support for `config` in the next major release 17+ if ( key === "config" ) {
18+ acc [ "configUrl" ] = value
19+ } else if ( key === "urls.primaryName" ) {
1720 acc [ key ] = value
1821 } else {
1922 acc = set ( acc , key , value )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import undefinedStringTypeCaster from "./type-casters/undefined-string"
1515import defaultOptions from "../defaults"
1616
1717const typeCasters = {
18- configUrl : { typeCaster : stringTypeCaster } ,
18+ configUrl : { typeCaster : nullableStringTypeCaster } ,
1919 deepLinking : {
2020 typeCaster : booleanTypeCaster ,
2121 defaultValue : defaultOptions . deepLinking ,
Original file line number Diff line number Diff line change @@ -51,10 +51,9 @@ export default function SwaggerUI(userOptions) {
5151 store . register ( [ mergedOptions . plugins , InlinePlugin ] )
5252 const system = store . getSystem ( )
5353
54- const configURL = queryOptions . config ?? mergedOptions . configUrl
5554 const systemOptions = optionsFromSystem ( { system } ) ( mergedOptions )
5655
57- optionsFromURL ( { url : configURL , system } ) ( mergedOptions )
56+ optionsFromURL ( { url : mergedOptions . configUrl , system } ) ( mergedOptions )
5857 . then ( ( urlOptions ) => {
5958 const urlOptionsFailedToFetch = urlOptions === null
6059
You can’t perform that action at this time.
0 commit comments