Closed klu2 closed 2 months ago
Hi @klu2, thank you for reporting the issue and your PR.
While looking into it, I noticed one more issue when rendering diagrams for model elements created using the structurizr API. So I took the extra mile and wrote a set of tests to ensure all diagram types are rendered properly when using the structurizr model API.
You can find the changes in #238 Since this PR addresses the same issues as your PR I will close your PR and will merge #238
If you add any elements (people, software systems, containers, components) to the model by using the original mehods from Structurizr (i.e.
addPerson
oraddContainer
), and you then generate views usingworkspace.writeDiagrams
, you get the following exception:The reason is that the default value for the element is not set in that case, as this method is not called and therefore
person.c4Location
is never set:And when
LocationExtension
tries to access that property later during diagram generation, an Exception is thrown.There are some ways to fix that, but I think easiest would be to return the default value
Location.Unspecified
insideLocationExtension