Media type for PlantUML files

0 votes
asked Feb 22, 2022 in Question / help by rapunzel (120 points)
Hi. I want to know if there is an existing media type for identify files containing PlantUML syntax. I think it would be very  useful, for software associations in desktop, or when someone publish a file on the web. Thanks.
commented Feb 23, 2022 by Martin (8,360 points)
moved Feb 23, 2022 by Martin

If you're asking what file extension to use, the recommendation is .puml, as per the answer to this question: https://forum.plantuml.net/14955/recommended-plantuml-filename-extension

commented Feb 23, 2022 by rapunzel (120 points)
No, I'm asking about media type: e.g. for text/markdown for Markdown files, or image/svg for SVG images. I want to know if there is a media type that is been used to identify PlantUML content, officialy or not. If none are in use, I'd suggest text/vnd.plantuml, similar to the media type used for GraphViz (text/vnd.graphviz), but I'm not sure.
commented Feb 23, 2022 by Martin (8,360 points)
Apologies for misunderstanding, I've retracted my answer into a comment.
commented Feb 24, 2022 by chris (2,540 points)
text/plain would be my vote, text/vnd.plantuml is acceptable but these days is a mute point as you absolutely should not be using that information for anything other than vanity anyway. Passing data from some random file on the internet to the plantuml processing engine (or anything else, same applies to image/svg, text/xml etc) is a recipe for trouble so you should never do this. The Content-Type HTTP header is to help the server understand what the sender intends to send, but should not be relied on other than to choose a validation algorithm, and if you're in control of the end points then you don't need the metadata - you're not going to have an endpoint that accepts both puml files and XML...right?

For the desktop, you can set your own software associations and most OS will prompt you to do that the first time you try to open that sort of file; if you're in an organisation then you can use e.g. a group policy if your machines are windows and you have enough users using PlantUML that it's worth it.

My 2 cents

1 Answer

0 votes
answered Jun 30, 2023 by Ovidiu
Some filemanagers offers a preview based on mime type, and in this case I find it useful to preview the generated png instead of a text file
...