Skip to content

Commit

Permalink
Add debug implementation for SwaggerUi (#1276)
Browse files Browse the repository at this point in the history
Add missing `debug` feature implementation for `SwaggerUi` and other
types with `#[cfg_attr(feature = "debug", ...)]`.

Fixes #1274
  • Loading branch information
juhaku authored Jan 5, 2025
1 parent 3ffad4b commit d765c98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utoipa-swagger-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

* Update axum to v0.8 (https://github.com/juhaku/utoipa/pull/1269)

### Fixed

* Add debug implementation for SwaggerUi (https://github.com/juhaku/utoipa/pull/1276)

## 8.1.0 - Dec 19 2024

### Added
Expand Down
1 change: 1 addition & 0 deletions utoipa-swagger-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ more details at [serve](https://docs.rs/utoipa-swagger-ui/latest/utoipa_swagger_
* **`url`** Enabled by default for parsing and encoding the download URL.
* **`vendored`** Enables vendored Swagger UI via `utoipa-swagger-ui-vendored` crate.
- **`cache`** Enables caching of the Swagger UI download in `utoipa-swagger-ui` during the build process.
- **`debug`**: Implement debug trait for SwaggerUi and other types.

## Install

Expand Down
2 changes: 2 additions & 0 deletions utoipa-swagger-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,7 @@ impl From<String> for Config<'_> {
/// Basic auth options for Swagger UI. By providing `BasicAuth` to `Config::basic_auth` the access to the
/// Swagger UI can be restricted behind given basic authentication.
#[derive(Serialize, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct BasicAuth {
/// Username for the `BasicAuth`
pub username: String,
Expand All @@ -1354,6 +1355,7 @@ pub struct BasicAuth {
/// Represents settings related to syntax highlighting of payloads and
/// cURL commands.
#[derive(Serialize, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[non_exhaustive]
pub struct SyntaxHighlight {
/// Boolean telling whether syntax highlighting should be
Expand Down

0 comments on commit d765c98

Please sign in to comment.