Examples of generateJsonSchema()


Examples of org.codehaus.jackson.map.ObjectMapper.generateJsonSchema()

     */
    public void testSchemaSerialization()
            throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        JsonSchema jsonSchema = mapper.generateJsonSchema(SimpleBean.class);
  Map<String,Object> result = writeAndMap(mapper, jsonSchema);
  assertNotNull(result);
  // no need to check out full structure, just basics...
  assertEquals("object", result.get("type"));
  assertEquals(Boolean.TRUE, result.get("optional"));
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.generateJsonSchema()

        throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        // not ok to pass null
        try {
            mapper.generateJsonSchema(null);
        } catch (IllegalArgumentException iae) { }
    }

    public static class SimpleBean
    {
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.generateJsonSchema()

            for (Iterator<Class> it = classSet.iterator(); it.hasNext();) {
                Class next = it.next();

                try {

                    JsonSchema schema = mapper.generateJsonSchema(next);
                    String jsonName = derriveName(next);
                    ObjectNode schemaNode = schema.getSchemaNode();
                    schemaNode.put("name", jsonName);
                   
                    CharArrayWriter writer = new CharArrayWriter();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.