From 5d0a41e73a2f21103aa5445c1900149ddf0e85aa Mon Sep 17 00:00:00 2001 From: zc Date: Fri, 1 Dec 2023 12:01:15 +0800 Subject: [PATCH] add case to makeRef --- util.go | 3 +-- util_test.go | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/util.go b/util.go index 53a6113..8b7ef8f 100644 --- a/util.go +++ b/util.go @@ -32,8 +32,7 @@ var ( // ColonPath accepts a swagger path. // -// e.g. /api/orgs/{org} and returns a colon identified path -// +// e.g. /api/org/{org} and returns a colon identified path // e.g. /api/org/:org func ColonPath(path string) string { matches := rePath.FindAllStringSubmatch(path, -1) diff --git a/util_test.go b/util_test.go index 891924e..d669b96 100644 --- a/util_test.go +++ b/util_test.go @@ -78,3 +78,8 @@ func Test_makeName(t *testing.T) { }) } } + +func Test_makeRef(t *testing.T) { + assert.Equal(t, "#/definitions/test1", makeRef("test1")) + assert.Equal(t, "#/definitions/HelloWorld", makeRef("HelloWorld")) +}