NUIG2014
NUIG2014

Reputation: 197

Is it possible to force the value type in a YAML file using snakeYaml

Currently I have a YAML file with a Key-Value pair specified as following:

name: bla

Is there a way to force the value to be a String without quoting "bla".

Upvotes: 2

Views: 2856

Answers (1)

flyx
flyx

Reputation: 39738

Sure, tag it:

name: !!str bla

You can also use the non-specific tag !, which will also resolve to a string:

name: ! bla

Upvotes: 1

Related Questions