structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 266 forks source link

Groups with no curly braces breaks diagrams #324

Closed DevRayy closed 1 year ago

DevRayy commented 1 year ago

Description

Defining a group with no curly braces produces strange diagrams. For example consider this code:

workspace {
    model {
        softwareSystem "Foo" {
            container "c0"

            group "Outer" {
                container "c1" {
                    group "Foo" {

                    }
                }
            }

            container "c2" { 

            }
        }
    }

}

It renders container diagram as expected:

image

But when I remove braces from group Foo suddenly container c2 renders inside Outer group:

workspace {
    model {
        softwareSystem "Foo" {
            container "c0"

            group "Outer" {
                container "c1" {
                    group "Foo"
                }
            }

            container "c2" { 

            }
        }
    }
}
image

Basically using non-braced group breaks everything that lives in lines below said group. When I try to add views below model block i get Unexpected token error at line with view definition - somehow tokenizer/interpreter thinks this is still inside model block.

I think its strange that defining non-braced (or even braced, but empty) groups is permitted considering they are not rendered at all.

Steps to reproduce

See above

Screenshot

No response

Code sample

No response

Configuration

No response

Severity

Minor

Priority

Low

Resolution

I have no budget, please fix this for free

More information

No response