Closed jeffersongirao closed 2 months ago
Generally I think it's valid. I think I can review it in the next days. Please consider that not only JSON is a valid format for openapi and asyncapi. At least yaml is one too.
Please consider that not only JSON is a valid format for openapi and asyncapi. At least yaml is one too.
That is true 👍. As it is implemented though I'm making an assumption that is JSON based on the line count given that new lines have semantic value in YAML. As it is it currently it would only break with a single line YAML definition and that would be an invalid API definition anyway I think.
Please consider that not only JSON is a valid format for openapi and asyncapi. At least yaml is one too.
That is true 👍. As it is implemented though I'm making an assumption that is JSON based on the line count given that new lines have semantic value in YAML. As it is it currently it would only break with a single line YAML definition and that would be an invalid API definition anyway I think.
Totally, true. We can leave it like this.
@jeffersongirao new version should be available in a few mintes.
Hello again @dweber019!
This is more to trigger a discussion if you would like to support this use case. The code probably deserves some improvement but I would love to get your feedback in the general direction. 🙂 👍
The context:
When using
$text
placeholders for API entities targeting autogenerated OpenAPI specs, like the ones generated by spring-boot-open-api default behaviour, the output is not very readable (and breaks the layout).The change proposed in the PR checks if the definition is a one-liner, if so then will assume it is not formatted and will pretty print it before processing.
Thanks in advance 🙏