@@ -264,7 +264,7 @@ public void testNumberKey() throws Exception
264
264
// [dataformats-text#246]
265
265
public void testMinimizeQuotesSpecialCharsMultiLine () throws Exception
266
266
{
267
- Map <String , Object > content = new HashMap <String , Object >();
267
+ Map <String , Object > content = new HashMap <>();
268
268
content .put ("key" , "first\n second: third" );
269
269
String yaml = MINIM_MAPPER .writeValueAsString (content ).trim ();
270
270
@@ -277,7 +277,7 @@ public void testMinimizeQuotesSpecialCharsMultiLine() throws Exception
277
277
// in minimized mode
278
278
public void testQuotingOfTilde () throws Exception
279
279
{
280
- Map <String , Object > content = new HashMap <String , Object >();
280
+ Map <String , Object > content = new HashMap <>();
281
281
content .put ("key" , "~" );
282
282
283
283
assertEquals ("---\n " +
@@ -288,4 +288,17 @@ public void testQuotingOfTilde() throws Exception
288
288
"key: \" ~\" " ,
289
289
MINIM_MAPPER .writeValueAsString (content ).trim ());
290
290
}
291
+
292
+ // [dataformats-text#492]: too aggressive dropping of quoting?
293
+ // (wrt [dataformats-text#465] change in 2.17)
294
+ public void testMinimalHashQuoting492 () throws Exception
295
+ {
296
+ Map <String , String > content = Collections .singletonMap ("$ref" ,
297
+ "core-api.yaml#/components/responses/ClientError" );
298
+ String yaml = MINIM_MAPPER .writeValueAsString (content );
299
+
300
+ Map <?, ?> result = MINIM_MAPPER .readValue (yaml , Map .class );
301
+
302
+ assertEquals (content , result );
303
+ }
291
304
}
0 commit comments