@@ -146,7 +146,7 @@ public static <T> T readObjectFromYamlFileInResources(String resource, Class<T>
146146 }
147147 ObjectMapper mapper = new YAMLMapper ().configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , !ignoreUnknownProperties );
148148 try {
149- return mapper .readValue (url , c );
149+ return mapper .readValue (url . openStream () , c );
150150 } catch (InvalidFormatException e ) {
151151 throw new IllegalArgumentException (e );
152152 } catch (IOException e ) {
@@ -223,7 +223,7 @@ public static <T> String writeObjectToYamlString(T instance) {
223223 try {
224224 ObjectMapper mapper = new YAMLMapper ()
225225 .disable (YAMLGenerator .Feature .USE_NATIVE_TYPE_ID )
226- .setSerializationInclusion (JsonInclude .Include .NON_EMPTY );
226+ .setDefaultPropertyInclusion (JsonInclude .Include .NON_EMPTY );
227227 return mapper .writeValueAsString (instance );
228228 } catch (JsonProcessingException e ) {
229229 throw new RuntimeException (e );
@@ -241,7 +241,7 @@ public static <T> String writeObjectToYamlString(T instance) {
241241 */
242242 public static <T > String writeObjectToJsonString (T instance ) {
243243 try {
244- ObjectMapper mapper = new ObjectMapper ().setSerializationInclusion (JsonInclude .Include .NON_NULL );
244+ ObjectMapper mapper = new ObjectMapper ().setDefaultPropertyInclusion (JsonInclude .Include .NON_NULL );
245245 return mapper .writeValueAsString (instance );
246246 } catch (JsonProcessingException e ) {
247247 throw new RuntimeException (e );
0 commit comments