From 158c899176aa0d695e27a6bfd0cddda4e57312f3 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Tue, 27 Jun 2017 17:26:24 -0700 Subject: [PATCH] "name" -> "urls.primaryName" --- README.md | 6 ++++-- src/core/index.js | 2 +- src/plugins/topbar/topbar.jsx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 12ad7e6c..bd117ed6 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,13 @@ If you'd like to use the bundle files via npm, check out the [`swagger-ui-dist` #### Parameters +Parameters with dots in their names are single strings used to organize subordinate parameters, and are not indicative of a nested structure. + Parameter Name | Description --- | --- -url | The url pointing to API definition (normally `swagger.json` or `swagger.yaml`). Will be ignored if `urls` or `spec` is used. +url | The url pointing to API definition (normally `swagger.json` or `swagger.yaml`). Will be ignored if `urls` or `spec` is used. urls | An array of API definition objects (`{url: "", name: ""}`) used by Topbar plugin. When used and Topbar plugin is enabled, the `url` parameter will not be parsed. -name | When using `urls`, you can use this parameter select an initial spec instead of defaulting to the first one. Useful as a query parameter to link to a specific spec. +urls.primaryName | When using `urls`, you can use this subparameter select an initial spec instead of defaulting to the first one. Useful as a query parameter to link to a specific spec. spec | A JSON object describing the OpenAPI Specification. When used, the `url` parameter will not be parsed. This is useful for testing manually-generated specifications without hosting them. validatorUrl | By default, Swagger-UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it to `null` will disable validation. dom_id | The id of a dom element inside which SwaggerUi will put the user interface for swagger. diff --git a/src/core/index.js b/src/core/index.js index e01f4451..107001cb 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -6,7 +6,7 @@ import ApisPreset from "core/presets/apis" import * as AllPlugins from "core/plugins/all" import { parseSeach, filterConfigs } from "core/utils" -const CONFIGS = [ "url", "urls", "name", "spec", "validatorUrl", "onComplete", "onFailure", "authorizations", "docExpansion", +const CONFIGS = [ "url", "urls", "urls.primaryName", "spec", "validatorUrl", "onComplete", "onFailure", "authorizations", "docExpansion", "apisSorter", "operationsSorter", "supportedSubmitMethods", "dom_id", "defaultModelRendering", "oauth2RedirectUrl", "showRequestHeaders", "custom", "modelPropertyMacro", "parameterMacro", "displayOperationId" ] diff --git a/src/plugins/topbar/topbar.jsx b/src/plugins/topbar/topbar.jsx index 30655b33..ce440a55 100644 --- a/src/plugins/topbar/topbar.jsx +++ b/src/plugins/topbar/topbar.jsx @@ -58,7 +58,7 @@ export default class Topbar extends React.Component { const urls = configs.urls || [] if(urls && urls.length) { - let selectedName = configs.name + let selectedName = configs["urls.primaryName"] if(selectedName) { urls.forEach((spec, i) => {