yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.88k stars 215 forks source link

Diagram options for SeqDiag not respected #1251

Closed paescuj closed 2 years ago

paescuj commented 2 years ago

First of all, Kroki is awesome! Thank you!

I've noticed that the diagram options for sequence diagrams are not respected. I wanted to use the no-transparency option, but the generated image was still transparent.

Other options / diagrams might be affected as well. Unfortunately, I've no time to further debug the issue at the moment...

I've tried all the available methods to pass the option (parameter, header, payload) but none of it seems to work.

Here is an example using curl:

payload=$(jq  --null-input --arg source "$(cat example.seqdiag)" '{"diagram_source": $source, "diagram_type": "seqdiag", "output_format": "png", "diagram_options": {"no-transparency": true}}')
curl 'https://kroki.io' -H 'Content-Type: application/json' -d "$payload" -o 'example.png'

The payload looks as follows:

{
  "diagram_source": "seqdiag {\n browser -> webserver [label = \"GET /seqdiag/svg/base64\"];\n webserver -> processor [label = \"Convert text to image\"];\n webserver <-- processor;\n browser <-- webserver;\n}",
  "diagram_type": "seqdiag",
  "output_format": "png",
  "diagram_options": {
    "no-transparency": true
  }
}
ggrossetie commented 2 years ago

I can reproduce this issue, my guess is that the diagram options are not propagated from the gateway server to the companion server.