Skip to content

Commit

Permalink
Expect rolesAllowed in OpenAPI scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mocenas committed Nov 11, 2024
1 parent b70b12f commit a4bea1a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ void rolesAllowedResourceAuthPermitted() {

// OpenAPI should generate per-scope security requirements only for OAuth2
// more info: https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/versions/3.0.1.md#patterned-fields-3
assertEquals(null, json.getString("paths.\"/secured/deny-all/{id}\".get.security[0].SecurityScheme[0]"));
assertEquals(null, json.getString("paths./secured/roles-allowed.get.security[0].SecurityScheme[0]"));
assertEquals(null, json.getString("paths.\"/secured/roles-allowed/{id}\".get.security[0].SecurityScheme[0]"));
assertEquals(null, json.getString("paths.\"/secured/roles-allowed/{id}\".delete.security[0].SecurityScheme[0]"));
assertEquals("admin", json.getString("paths.\"/secured/deny-all/{id}\".get.security[0].SecurityScheme[0]"));
assertEquals("admin", json.getString("paths./secured/roles-allowed.get.security[0].SecurityScheme[0]"));
assertEquals("admin", json.getString("paths.\"/secured/roles-allowed/{id}\".get.security[0].SecurityScheme[0]"));
assertEquals("user", json.getString("paths.\"/secured/roles-allowed/{id}\".delete.security[0].SecurityScheme[0]"));

List<String> list = json.getList("components.schemas.Article.required");
assertEquals(2, list.size());
Expand Down

0 comments on commit a4bea1a

Please sign in to comment.