File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/test/java/com/fasterxml/jackson/module/jsonSchema Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
package com .fasterxml .jackson .module .jsonSchema ;
2
2
3
3
import com .fasterxml .jackson .annotation .JsonUnwrapped ;
4
+ import com .fasterxml .jackson .databind .MapperFeature ;
4
5
import com .fasterxml .jackson .databind .ObjectMapper ;
5
6
6
7
public class TestUnwrapping extends SchemaTestBase
@@ -27,12 +28,13 @@ static class Name {
27
28
28
29
public void testUnwrapping () throws Exception
29
30
{
30
- JsonSchemaGenerator generator = new JsonSchemaGenerator (MAPPER );
31
+ ObjectMapper mapper = new ObjectMapper ();
32
+ mapper .configure (MapperFeature .SORT_PROPERTIES_ALPHABETICALLY , true );
33
+ JsonSchemaGenerator generator = new JsonSchemaGenerator (mapper );
31
34
JsonSchema schema = generator .generateSchema (UnwrappingRoot .class );
32
35
33
- String json = MAPPER .writeValueAsString (schema ).replace ('"' , '\'' );
36
+ String json = mapper .writeValueAsString (schema ).replace ('"' , '\'' );
34
37
35
- //System.err.println("JSON -> "+MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(schema));
36
38
String EXP = "{'type':'object'," +
37
39
"'id':'urn:jsonschema:com:fasterxml:jackson:module:jsonSchema:TestUnwrapping:UnwrappingRoot'," +
38
40
"'properties':{'age':{'type':'integer'},'name.first':{'type':'string'},'name.last':{'type':'string'}}}" ;
You can’t perform that action at this time.
0 commit comments