Optional quoting
See original GitHub issueHi guys, we are using this great library(!) to generate configuration files for our microservices.
It works perfectly and we have no issues with that, but there is one thing that we could improve in generated files.
Basically this is what we get after using YamlBuilders to create yaml file:
application:
name: template
"instance-id": "${random.uuid}"
version: @project.version@
server:
port: 8081
spring:
kafka:
"bootstrap-servers": "localhost:8092"
cloud:
kubernetes:
enabled: false
as you can see, some of the key/values are quoted – "
.
Is there a poissibility to always skip quotes so the outcome would be:
application:
name: template
instance-id: ${random.uuid}
version: @project.version@
server:
port: 8081
spring:
kafka:
bootstrap-servers: localhost:8092
cloud:
kubernetes:
enabled: false
?
I search docs and closed tickets, but could not find answer for my question.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Optional Quotes - BrainyQuote
Optional Quotes · The rule of law means that law and justice are upheld by an independent judiciary. · Growing old is mandatory;...
Read more >Citation Guide: Optional Elements - LibGuides
All citations should include the following elements: 1. Author. 2. Title of Source.
Read more >Optional Line Items on Quotes - Jobber Help Center
Optional line items provide clients with extra products and services they can choose to add onto their quote. Maybe these are items that...
Read more >Optional Items | Quoter Software
Cross-sell & upsell with optionals. This feature will give you the ability to add line items to your quotes that are optional for...
Read more >Making Price Lines Optional in a Sales Quote - QuoteCloud
Sometimes it may be useful to let a customer decide between different products or price options. This can be acheived by grouping price...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see, thanks for providing detailed explanation and customization example! 🚀
@sta-szek There is no option to unquote them. There were lengthy discussions around here about special characters and quotation, so we decided to just quote (escape) any string (key or value) which contains YAML special characters such as
:
or-
.However, don’t forget that both YamlMapping and YamlSequence are interfaces, so you can most likely write your own decorator which would remove these quotations. Something like this:
Then you would just use this class as follows:
And this
unqoted
YamlMapping should behave/print as you wish, without qoutes 😄Does this help? I’m afraid there is no other option.
We will not change the quoting mechanism because, as I said, there were a lot of discussions and we finally come to a point where most users are happy.