Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ private String extractUrlTemplate(Operation operation) {

private static String getParameterName(String match) {
int colonIndex = match.indexOf(':');
return (colonIndex != -1) ? match.substring(0, colonIndex) : match;
String name = (colonIndex != -1) ? match.substring(0, colonIndex) : match;
return name.startsWith("*") ? name.substring(1) : name;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ void additionalDescriptorsWithRelaxedRequestParameters(OperationBuilder operatio
.row("`b`", "two"));
}

@RenderedSnippetTest
void pathParametersWithCaptureVariable(OperationBuilder operationBuilder, AssertableSnippets snippets,
TemplateFormat templateFormat) throws IOException {
new PathParametersSnippet(
Arrays.asList(parameterWithName("a").description("one"), parameterWithName("b").description("two")))
.document(operationBuilder.attribute(RestDocumentationGenerator.ATTRIBUTE_NAME_URL_TEMPLATE, "/{a}/{*b}")
.build());
assertThat(snippets.pathParameters()).isTable(
(table) -> table.withTitleAndHeader(getTitle(templateFormat, "/{a}/{*b}"), "Parameter", "Description")
.row("`a`", "one")
.row("`b`", "two"));
}

@RenderedSnippetTest
void pathParametersWithEscapedContent(OperationBuilder operationBuilder, AssertableSnippets snippets,
TemplateFormat templateFormat) throws IOException {
Expand Down
Loading