diff --git a/lib/open_api_spex/paths.ex b/lib/open_api_spex/paths.ex index ba7b2e2f..72c40e1a 100644 --- a/lib/open_api_spex/paths.ex +++ b/lib/open_api_spex/paths.ex @@ -84,7 +84,7 @@ defmodule OpenApiSpex.Paths do rest |> Enum.with_index(2) |> Enum.map(fn {{path, verb, operation}, occurrence} -> - {path, verb, %{operation | operationId: "#{operation_id} (#{occurrence})"}} + {path, verb, %{operation | operationId: "#{operation_id}_#{occurrence}"}} end) end) end diff --git a/test/paths_test.exs b/test/paths_test.exs index 4bec9a9f..47338b31 100644 --- a/test/paths_test.exs +++ b/test/paths_test.exs @@ -18,7 +18,7 @@ defmodule OpenApiSpex.PathsTest do operation_ids = [pets_path_item.put.operationId, pets_path_item.patch.operationId] assert "OpenApiSpexTest.PetController.update" in operation_ids - assert "OpenApiSpexTest.PetController.update (2)" in operation_ids + assert "OpenApiSpexTest.PetController.update_2" in operation_ids end end end