diff --git a/docs/usage/configuration.md b/docs/usage/configuration.md index c0ec34eea47..d1c1252e671 100644 --- a/docs/usage/configuration.md +++ b/docs/usage/configuration.md @@ -288,6 +288,7 @@ Parameter name | Docker variable | Description `responseInterceptor` | _Unavailable_ | `Function=(a => a)`. MUST be a function. Function to intercept remote definition, "Try it out", and OAuth 2.0 responses. Accepts one argument responseInterceptor(response) and must return the modified response, or a Promise that resolves to the modified response. `showMutatedRequest` | `SHOW_MUTATED_REQUEST` | `Boolean=true`. If set to `true`, uses the mutated request returned from a requestInterceptor to produce the curl command in the UI, otherwise the request before the requestInterceptor was applied is used. `supportedSubmitMethods` | `SUPPORTED_SUBMIT_METHODS` | `Array=["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"]`. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. +For OpenAPI 3.2 `additionalOperations`, custom method tokens are case-sensitive and must be listed exactly (e.g. `["get", "COPY", "Search-Pets"]`). Custom operations are always displayed; they are only executable when listed here. Execution requires `swagger-client` 3.38.2 or later. Browsers may still block some methods or cross-origin requests (CORS). `validatorUrl` | `VALIDATOR_URL` | `String="https://validator.swagger.io/validator" OR null`. 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 either `none`, `127.0.0.1` or `localhost` will disable validation. `withCredentials` | `WITH_CREDENTIALS` | `Boolean=false` If set to `true`, enables passing credentials, [as defined in the Fetch standard](https://fetch.spec.whatwg.org/#credentials), in CORS requests that are sent by the browser. Note that Swagger UI cannot currently set cookies cross-domain (see [swagger-client#1163](https://github.com/swagger-api/swagger-client/issues/1163)) - as a result, you will have to rely on browser-supplied cookies (which this setting enables sending) that Swagger UI cannot control. diff --git a/src/core/components/layouts/base.jsx b/src/core/components/layouts/base.jsx index e5f0b52bfda..0c6f6ef2660 100644 --- a/src/core/components/layouts/base.jsx +++ b/src/core/components/layouts/base.jsx @@ -135,7 +135,7 @@ export default class BaseLayout extends React.Component { - {isOAS31 && ( + {(isOAS31 || isOAS32) && ( diff --git a/src/core/components/operation-summary-method.jsx b/src/core/components/operation-summary-method.jsx index b625e725dbd..b4e16e488d8 100644 --- a/src/core/components/operation-summary-method.jsx +++ b/src/core/components/operation-summary-method.jsx @@ -1,6 +1,7 @@ import React, { PureComponent } from "react" import PropTypes from "prop-types" import { Iterable } from "immutable" +import { OPERATION_METHODS } from "core/utils/operation-methods" export default class OperationSummaryMethod extends PureComponent { @@ -19,7 +20,7 @@ export default class OperationSummaryMethod extends PureComponent { } = this.props return ( - {method.toUpperCase()} + {OPERATION_METHODS.includes(method) ? method.toUpperCase() : method} ) } } diff --git a/src/core/components/operation-summary.jsx b/src/core/components/operation-summary.jsx index b90c2981f6a..5083db15803 100644 --- a/src/core/components/operation-summary.jsx +++ b/src/core/components/operation-summary.jsx @@ -63,7 +63,7 @@ export default class OperationSummary extends PureComponent { const securityIsOptional = hasSecurity && security.size === 1 && security.first().isEmpty() const allowAnonymous = !hasSecurity || securityIsOptional return ( -
+