gaphor / gaphor

Gaphor is the simple modeling tool
https://gaphor.org
1.87k stars 200 forks source link

Not able to add {readOnly} to property #3327

Closed matgaj closed 3 months ago

matgaj commented 5 months ago

Describe the bug

Gaphor won't allow appending a read {readOnly} to a property.

To Reproduce

  1. Create class
  2. Add property, eg. "+Property: type"
  3. Try adding readOnly attribute: "+Property: type {readOnly}"
  4. Gaphor deletes the curly brackets and their contents

Expected behavior

Correct handling of attributes, as described on page 17 of the UML specification.

Screenshots

obraz

OS

Windows 11 Pro 23H2

Version

Version of Gaphor: 2.25.1

Additional information

amolenaar commented 4 months ago

Hi @matgaj,

I think the parser skips over {...} blocks. Those blocks normally refer to attributes assigned from stereotypes. This currently does not happen for attributes.

You can cheat a bit by defining it as - parent: Player = {readonly}, then {readonly} is assigned as default value.

danyeaw commented 3 months ago

@all-contributors please add @matgaj for idea

allcontributors[bot] commented 3 months ago

@danyeaw

I've put up a pull request to add @matgaj! :tada: