From 5bb6b73526b9f21c578f44aa9c7be9ae0aa18fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Mon, 15 Mar 2021 15:26:54 +0100 Subject: [PATCH] Fix names for open api spec (#1582) Names must not contain spaces, therefore we replace them with underscores. --- gradle/changelog/auth_names_open_api_spec.yaml | 2 ++ .../sonia/scm/api/v2/resources/AuthenticationResource.java | 6 +++--- .../main/java/sonia/scm/api/v2/resources/IndexResource.java | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 gradle/changelog/auth_names_open_api_spec.yaml diff --git a/gradle/changelog/auth_names_open_api_spec.yaml b/gradle/changelog/auth_names_open_api_spec.yaml new file mode 100644 index 0000000000..c176394627 --- /dev/null +++ b/gradle/changelog/auth_names_open_api_spec.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Authentication names in open api spec ([#1582](https://github.com/scm-manager/scm-manager/issues/1582)) diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java index 27d41b5dd4..173774f7e0 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/AuthenticationResource.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.api.v2.resources; import com.google.inject.Inject; @@ -66,13 +66,13 @@ import java.util.Optional; @SecuritySchemes({ @SecurityScheme( - name = "Basic Authentication", + name = "Basic_Authentication", description = "HTTP Basic authentication with username and password", scheme = "basic", type = SecuritySchemeType.HTTP ), @SecurityScheme( - name = "Bearer Token Authentication", + name = "Bearer_Token_Authentication", description = "Authentication with a jwt bearer token", scheme = "bearer", bearerFormat = "JWT", diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/IndexResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/IndexResource.java index 1ad23efea6..00e5cd468a 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/IndexResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/IndexResource.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.api.v2.resources; import io.swagger.v3.oas.annotations.OpenAPIDefinition; @@ -41,8 +41,8 @@ import javax.ws.rs.Produces; @OpenAPIDefinition( security = { - @SecurityRequirement(name = "Basic Authentication"), - @SecurityRequirement(name = "Bearer Token Authentication") + @SecurityRequirement(name = "Basic_Authentication"), + @SecurityRequirement(name = "Bearer_Token_Authentication") }, tags = { @Tag(name = "Index", description = "SCM-Manager Index")