Skip to content

Commit

Permalink
Updated Swagger UI to v5.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ralpha committed Jan 14, 2024
1 parent 8421dbd commit 612b17f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
6 changes: 4 additions & 2 deletions rocket-okapi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
All notable changes to this project will be documented in this file.
This project follows the [Semantic Versioning standard](https://semver.org/).

## Unreleased (2023-xx-xx)
## Unreleased (2024-xx-xx)

### Added

Expand All @@ -16,7 +16,7 @@ This project follows the [Semantic Versioning standard](https://semver.org/).

### Security

## Unreleased Version 0.8.0 (2023-xx-xx)
## Unreleased Version 0.8.0 (2024-xx-xx)

### Added
- Added support for new [`Responder`](https://docs.rs/rocket/0.5.0/rocket/response/trait.Responder.html)
Expand All @@ -38,6 +38,7 @@ This project follows the [Semantic Versioning standard](https://semver.org/).
- `rocket_dyn_templates::Metadata<'r>` (when `rocket_dyn_templates` feature is enabled)
- `rocket_sync_db_pools::example::ExampleDb` (when `rocket_sync_db_pools` feature is enabled)
- `rocket_ws::WebSocket` (when `rocket_ws` feature is enabled)
- Added `get_nested_endpoints_and_docs` to support more module based APIs. (#137, #138)

### Changed
- `rocket-okapi` and `rocket-okapi-codegen` require `rocket v0.5.0`. (#132)
Expand All @@ -53,6 +54,7 @@ This project follows the [Semantic Versioning standard](https://semver.org/).
- `SlotsConfig` added: `operations_top`.
- Note: The default `RenderStyle` changed from `View` to `Read`.
- Note: `schema_hide_read_only` and `schema_hide_write_only` changed behavior.
- Updated Swagger UI to `v5.11.0`.
- Updated all crates to Rust 2021 edition.
- Renamed `uuid` example to `uuid_usage`, so it does not collide with `uuid` crate.

Expand Down
3 changes: 3 additions & 0 deletions rocket-okapi/src/swagger_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ macro_rules! static_file {
};
}

// To update this structures use;
// https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md

/// Used to control the way models are displayed by default.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down
6 changes: 3 additions & 3 deletions rocket-okapi/swagger-ui/oauth2-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var isValid, qp, arr;

if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
qp = window.location.hash.substring(1).replace('?', '&');
} else {
qp = location.search.substring(1);
}
Expand All @@ -38,7 +38,7 @@
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
});
}

Expand All @@ -58,7 +58,7 @@
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
});
}
} else {
Expand Down
32 changes: 16 additions & 16 deletions rocket-okapi/swagger-ui/swagger-initializer.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
window.onload = function () {
//<editor-fold desc="Changeable Configuration Block">
//<editor-fold desc="Changeable Configuration Block">

// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
configUrl: "./swagger-ui-config.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
configUrl: "./swagger-ui-config.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});

//</editor-fold>
//</editor-fold>
};
2 changes: 1 addition & 1 deletion rocket-okapi/swagger-ui/swagger-ui-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rocket-okapi/swagger-ui/swagger-ui-standalone-preset.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions rocket-okapi/swagger-ui/swagger-ui.css

Large diffs are not rendered by default.

0 comments on commit 612b17f

Please sign in to comment.