feat: apply cumulative update to address various issues (#10324)

This commit is contained in:
Vladimír Gorej
2025-02-27 11:12:42 +01:00
committed by GitHub
parent 621a7f0f76
commit 80d56c9518
298 changed files with 11066 additions and 11680 deletions

View File

@@ -33,7 +33,7 @@ Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false`
Install `swagger-ui-react`:
```
$ npm i --save swagger-ui-react
$ npm install swagger-ui-react
```
Use it in your React application:
@@ -194,6 +194,11 @@ Redirect url given as parameter to the oauth2 provider. Default the url refers t
⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.
#### `initialState`: PropTypes.object
Passes initial values to the Swagger UI state.
⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.
## Limitations

View File

@@ -45,6 +45,7 @@ const SwaggerUI = ({
persistAuthorization = config.defaults.persistAuthorization,
oauth2RedirectUrl = config.defaults.oauth2RedirectUrl,
onComplete = null,
initialState = config.defaults.initialState,
}) => {
const [system, setSystem] = useState(null)
const SwaggerUIComponent = system?.getComponent("App", "root")
@@ -83,6 +84,7 @@ const SwaggerUI = ({
filter,
persistAuthorization,
withCredentials,
initialState,
...(typeof oauth2RedirectUrl === "string"
? { oauth2RedirectUrl: oauth2RedirectUrl }
: {}),
@@ -165,6 +167,7 @@ SwaggerUI.propTypes = {
persistAuthorization: PropTypes.bool,
withCredentials: PropTypes.bool,
oauth2RedirectUrl: PropTypes.string,
initialState: PropTypes.object,
}
SwaggerUI.System = SwaggerUIConstructor.System
SwaggerUI.presets = SwaggerUIConstructor.presets