Skip to content

Commit dd93120

Browse files
authored
Merge pull request #50 from zerochae/feature/improve-duplicate-filtering
feat: Improve endpoint duplicate filtering for monorepo and microservice support
2 parents 729fec5 + 1bb6d59 commit dd93120

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/endpoint/core/Framework.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,16 @@ end
256256

257257
---Post-processes endpoints to remove duplicates and clean up
258258
function Framework:_post_process_endpoints(endpoints)
259-
-- Remove duplicates based on method + path only (ignore file/line differences)
259+
-- Remove duplicates based on method + path + file (preserve endpoints from different files)
260260
local seen = {}
261261
local unique_endpoints = {}
262262

263263
for _, endpoint in ipairs(endpoints) do
264-
local key = string.format("%s:%s", endpoint.method or "", endpoint.endpoint_path or "")
264+
local key = string.format("%s:%s:%s",
265+
endpoint.method or "",
266+
endpoint.endpoint_path or "",
267+
endpoint.file_path or ""
268+
)
265269

266270
if not seen[key] then
267271
seen[key] = true

0 commit comments

Comments
 (0)