From a0b72606eca84735bd939ea0b40906a764a16725 Mon Sep 17 00:00:00 2001 From: Ted Wollman <25165500+TheTedder@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:04:43 -0400 Subject: [PATCH] Remove XML from swagger descriptions. --- LeaderboardBackend/Controllers/AccountController.cs | 8 ++++---- LeaderboardBackend/Controllers/UsersController.cs | 2 +- LeaderboardBackend/openapi.json | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LeaderboardBackend/Controllers/AccountController.cs b/LeaderboardBackend/Controllers/AccountController.cs index 858dd3c0..4360829f 100644 --- a/LeaderboardBackend/Controllers/AccountController.cs +++ b/LeaderboardBackend/Controllers/AccountController.cs @@ -32,7 +32,7 @@ public AccountController(IUserService userService) [SwaggerResponse( 409, """ - A `User` with the specified username or email already exists.

+ A `User` with the specified username or email already exists. Validation error codes by property: - **Username**: - **UsernameTaken**: the username is already in use @@ -44,7 +44,7 @@ public AccountController(IUserService userService) [SwaggerResponse( 422, """ - The request contains errors.

+ The request contains errors. Validation error codes by property: - **Username**: - **UsernameFormat**: Invalid username format @@ -114,7 +114,7 @@ [FromServices] IAccountConfirmationService confirmationService [SwaggerResponse( 422, """ - The request contains errors.

+ The request contains errors. Validation error codes by property: - **Password**: - **NotEmptyValidator**: No password was passed @@ -259,7 +259,7 @@ [FromServices] IAccountRecoveryService recoveryService [SwaggerResponse( 422, """ - The request body contains errors.
+ The request body contains errors. A **PasswordFormat** Validation error on the Password field indicates that the password format is invalid. """, typeof(ValidationProblemDetails) diff --git a/LeaderboardBackend/Controllers/UsersController.cs b/LeaderboardBackend/Controllers/UsersController.cs index df8d5d38..5ee2ca5f 100644 --- a/LeaderboardBackend/Controllers/UsersController.cs +++ b/LeaderboardBackend/Controllers/UsersController.cs @@ -46,7 +46,7 @@ public async Task> GetUserById( "Gets the currently logged-in User.", """ Call this method with the 'Authorization' header. A valid JWT bearer token must be - passed.
+ passed. Example: `{ 'Authorization': 'Bearer JWT' }`. """ )] diff --git a/LeaderboardBackend/openapi.json b/LeaderboardBackend/openapi.json index c9fdf855..5cb38704 100644 --- a/LeaderboardBackend/openapi.json +++ b/LeaderboardBackend/openapi.json @@ -37,7 +37,7 @@ "description": "The request was malformed." }, "409": { - "description": "A `User` with the specified username or email already exists.

\nValidation error codes by property:\n- **Username**:\n - **UsernameTaken**: the username is already in use\n- **Email**:\n - **EmailAlreadyUsed**: the email is already in use", + "description": "A `User` with the specified username or email already exists.\nValidation error codes by property:\n- **Username**:\n - **UsernameTaken**: the username is already in use\n- **Email**:\n - **EmailAlreadyUsed**: the email is already in use", "content": { "application/json": { "schema": { @@ -47,7 +47,7 @@ } }, "422": { - "description": "The request contains errors.

\nValidation error codes by property:\n- **Username**:\n - **UsernameFormat**: Invalid username format\n- **Password**:\n - **PasswordFormat**: Invalid password format\n- **Email**:\n - **EmailValidator**: Invalid email format", + "description": "The request contains errors.\nValidation error codes by property:\n- **Username**:\n - **UsernameFormat**: Invalid username format\n- **Password**:\n - **PasswordFormat**: Invalid password format\n- **Email**:\n - **EmailValidator**: Invalid email format", "content": { "application/json": { "schema": { @@ -103,7 +103,7 @@ "description": "No `User` with the requested details could be found." }, "422": { - "description": "The request contains errors.

\nValidation error codes by property:\n- **Password**:\n - **NotEmptyValidator**: No password was passed\n - **PasswordFormat**: Invalid password format\n- **Email**:\n - **NotNullValidator**: No email was passed\n - **EmailValidator**: Invalid email format", + "description": "The request contains errors.\nValidation error codes by property:\n- **Password**:\n - **NotEmptyValidator**: No password was passed\n - **PasswordFormat**: Invalid password format\n- **Email**:\n - **NotNullValidator**: No email was passed\n - **EmailValidator**: Invalid email format", "content": { "application/json": { "schema": { @@ -275,7 +275,7 @@ "description": "The new password is the same as the user's existing password." }, "422": { - "description": "The request body contains errors.
\nA **PasswordFormat** Validation error on the Password field indicates that the password format is invalid.", + "description": "The request body contains errors.\nA **PasswordFormat** Validation error on the Password field indicates that the password format is invalid.", "content": { "application/json": { "schema": { @@ -913,7 +913,7 @@ "Users" ], "summary": "Gets the currently logged-in User.", - "description": "Call this method with the 'Authorization' header. A valid JWT bearer token must be\npassed.
\nExample: `{ 'Authorization': 'Bearer JWT' }`.", + "description": "Call this method with the 'Authorization' header. A valid JWT bearer token must be\npassed.\nExample: `{ 'Authorization': 'Bearer JWT' }`.", "responses": { "200": { "description": "The `User` was found and returned successfully.",