[Vault-4628] OpenAPI endpoint not expanding root alternations (#13487)

This commit is contained in:
Vinny Mannello
2021-12-22 15:36:47 -08:00
committed by GitHub
parent b046cd9f80
commit d41f8cf1d0
3 changed files with 28 additions and 9 deletions

View File

@@ -199,6 +199,10 @@ func TestOpenAPI_ExpandPattern(t *testing.T) {
{"^plugins/catalog/(?P<type>auth|database|secret)/?$", []string{
"plugins/catalog/{type}",
}},
{"(pathOne|pathTwo)/", []string{"pathOne/", "pathTwo/"}},
{"(pathOne|pathTwo)/" + GenericNameRegex("name"), []string{"pathOne/{name}", "pathTwo/{name}"}},
{"(pathOne|path-2|Path_3)/" + GenericNameRegex("name"),
[]string{"Path_3/{name}", "path-2/{name}", "pathOne/{name}"}},
}
for i, test := range tests {