From 3933dff4679b27ad114299002f2a1bc57bfd286d Mon Sep 17 00:00:00 2001 From: Josh Price Date: Mon, 12 Sep 2022 10:10:33 +1000 Subject: [PATCH] fix: update handling of arrays with no special chars Hampered by this issue in Mermaid https://github.com/mermaid-js/mermaid/issues/1546 --- lib/ash/api/diagram/diagram.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ash/api/diagram/diagram.ex b/lib/ash/api/diagram/diagram.ex index 29423187a..6b81f399a 100644 --- a/lib/ash/api/diagram/diagram.ex +++ b/lib/ash/api/diagram/diagram.ex @@ -1,6 +1,6 @@ defmodule Ash.Api.Info.Diagram do @moduledoc """ - Generate a Mermaid Entity Relationship Diagram from a specified API. + Generate Mermaid diagrams from a specified API. """ def resources_with_attrs(api) do @@ -43,10 +43,10 @@ defmodule Ash.Api.Info.Diagram do def type(:has_one), do: "|o--||" def type(:many_to_many), do: "}o--o{" - def short_type({:array, t}), do: "[#{short_module(t)}]" + def short_type({:array, t}), do: "ArrayOf#{short_module(t)}" def short_type(t), do: short_module(t) - def mermaid(api) do + def mermaid_er_diagram(api) do indent = " " resources =