From 487a52fbfa6ad1226a6f66704d388af73662e3ee Mon Sep 17 00:00:00 2001 From: khusa Date: Fri, 16 Feb 2024 07:53:50 +0100 Subject: [PATCH 1/2] The provided tictactoe example is not valid and fails to be rendered in Redocly. Fixed syntax in application of security to the operations. Security is an array. --- examples/tictactoe.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/tictactoe.yaml b/examples/tictactoe.yaml index d27b80d..9d808a5 100644 --- a/examples/tictactoe.yaml +++ b/examples/tictactoe.yaml @@ -24,9 +24,9 @@ paths: schema: $ref: "#/components/schemas/status" security: - apiKey: [] - app2AppOauth: - - board:read + - bearerHttpAuthentication: [] + - user2AppOauth: + - board:write # Single square operations /board/{row}/{column}: @@ -54,9 +54,9 @@ paths: $ref: "#/components/schemas/errorMessage" example: "Illegal coordinates" security: - bearerHttpAuthentication: [] - user2AppOauth: - - board:read + - bearerHttpAuthentication: [] + - user2AppOauth: + - board:write put: summary: Set a single board square description: Places a mark on the board and retrieves the whole board and the winner (if any). @@ -90,9 +90,9 @@ paths: invalidMark: value: "Invalid Mark (X or O)." security: - bearerHttpAuthentication: [] - user2AppOauth: - - board:write + - bearerHttpAuthentication: [] + - user2AppOauth: + - board:write components: parameters: From 618541ac14fff6be6dcb0502706ce540652e0c22 Mon Sep 17 00:00:00 2001 From: khusa Date: Sat, 17 Feb 2024 11:09:35 +0100 Subject: [PATCH 2/2] Fixed security config. My previous commit fixed the syntax but did not respect the differences in the operation security (as was previously). --- examples/tictactoe.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tictactoe.yaml b/examples/tictactoe.yaml index 9d808a5..7f0e4fd 100644 --- a/examples/tictactoe.yaml +++ b/examples/tictactoe.yaml @@ -24,9 +24,9 @@ paths: schema: $ref: "#/components/schemas/status" security: - - bearerHttpAuthentication: [] - - user2AppOauth: - - board:write + - apiKey: [] + - app2AppOauth: + - board:read # Single square operations /board/{row}/{column}: @@ -56,7 +56,7 @@ paths: security: - bearerHttpAuthentication: [] - user2AppOauth: - - board:write + - board:read put: summary: Set a single board square description: Places a mark on the board and retrieves the whole board and the winner (if any).