Skip to content
Open
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
2 changes: 1 addition & 1 deletion operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ func parseMimeTypeList(mimeTypeList string, typeList *[]string, format string) e
return nil
}

var routerPattern = regexp.MustCompile(`^(/[\w./\-{}\(\)+:$~]*)[[:blank:]]+\[(\w+)]`)
var routerPattern = regexp.MustCompile(`^(/[\w./\-{}\(\)+:$~@]*)[[:blank:]]+\[(\w+)]`)

// ParseRouterComment parses comment for given `router` comment string.
func (operation *Operation) ParseRouterComment(commentLine string, deprecated bool) error {
Expand Down
9 changes: 9 additions & 0 deletions operation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ func TestParseRouterCommentWithTilde(t *testing.T) {
assert.NoError(t, err)
}

func TestParseRouterCommentWithAt(t *testing.T) {
t.Parallel()

comment := `@Router /users/@{id} [get]`
operation := NewOperation(nil)
err := operation.ParseComment(comment, nil)
assert.NoError(t, err)
}

func TestParseRouterCommentMethodSeparationErr(t *testing.T) {
t.Parallel()

Expand Down