Loading Java.Util.Set in to Spring ConfigurationProperties
<p>Following Spring @ConfigurationProperties Class</p>

<pre><code>@Component
@ConfigurationProperties(prefix = "prefix")
@EnableConfigurationProperties
public class config {
    private Set&lt;String&gt; mySet = new HashSet&lt;&gt;();
}
</code></pre>

<p>Following Yaml file</p>

<pre><code>prefix:
  mySet: !!set {'element1',  'element2'}
</code></pre>

<p>Using SnakeYaml version 1.16</p>

<p>Results in the follow error:</p>

<blockquote>
  <p>Caused by: org.springframework.beans.InvalidPropertyException: Invalid
  property 'messageDelivery[0]' of bean class
  [location.Config]:
  Property referenced in indexed property path 'mySet[0]' is
  neither an array nor a List nor a Map; returned value was [element1]</p>
</blockquote>

<p>Appears the error is occurring during serialization  </p>

<p><strong>Update</strong> </p>

<p>I tried with this yaml structure </p>

<pre><code>prefix:
    mySet:
        element1
        element2
</code></pre>

<p>This resulted in a Set with only one value which is "element1 element2" it concatenated both together need to find out what will allow me to separate the the elements from each other</p>