Examples of JsonSchemaGenerator


Examples of com.atlassian.json.schema.JsonSchemaGenerator

            {
                String ifaceJson = Files.toString(interfacesFile, Charsets.UTF_8);
                interfaceList = gson.fromJson(ifaceJson,InterfaceList.class);
            }

            JsonSchemaGenerator generator = provider.provide(getEnumCase(enumCase),interfaceList,schemaDocs,ignoreFilter);
            JsonSchema schema = generator.generateSchema(getRootClass());
           
            File rawFile = new File(rawOutput);
            File prettyFile = new File(prettyOutput);
           
            Files.createParentDirs(rawFile);
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator

    private JsonSchema getReturnType(Method method) throws JsonMappingException {
        Class<?> returnType = method.getReturnType();
        if (returnType.equals(Void.TYPE)) {
            return null;
        }
        JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
        return generator.generateSchema(method.getReturnType());
    }
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator

    final ObjectMapper MAPPER = objectMapper();
   
    // [Issue#14]: multiple type attributes
    public void testCorrectType() throws Exception
    {
        JsonSchemaGenerator generator = new JsonSchemaGenerator(MAPPER);
        JsonSchema jsonSchema = generator.generateSchema(Issue14Bean.class);
        String json = MAPPER.writeValueAsString(jsonSchema).replace('"', '\'');
        final String EXP = "{'type':'object'," +
                "'id':'urn:jsonschema:com:fasterxml:jackson:module:jsonSchema:TestTypeGeneration:Issue14Bean'," +
                "'properties':{'date':{'type':'integer','format':'UTC_MILLISEC'}}}";
        assertEquals(EXP, json);
View Full Code Here

Examples of com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator

   
    private final ObjectMapper MAPPER = objectMapper();

    public void testUnwrapping()  throws Exception
    {
        JsonSchemaGenerator generator = new JsonSchemaGenerator(MAPPER);
        JsonSchema schema = generator.generateSchema(UnwrappingRoot.class);

        String json = MAPPER.writeValueAsString(schema).replace('"', '\'');
       
//System.err.println("JSON -> "+MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(schema));
        String EXP = "{'type':'object','properties':{"
View Full Code Here

Examples of org.eclipse.persistence.internal.jaxb.json.schema.JsonSchemaGenerator

            generateSchema(outputResolver, null);
        }
    }

    public void generateJsonSchema(SchemaOutputResolver outputResolver, Class rootClass) {
        JsonSchemaGenerator generator = new JsonSchemaGenerator(this.contextState.getXMLContext(), this.contextState.properties);
        JsonSchema schema = generator.generateSchema(rootClass);
        try {
            Marshaller m = getJsonSchemaMarshaller();
            m.marshal(schema, outputResolver.createOutput(null, rootClass.getName() + ".json"));
        } catch (Exception ex) {
        }
View Full Code Here

Examples of org.eclipse.persistence.internal.jaxb.json.schema.JsonSchemaGenerator

            generateSchema(outputResolver, null);
        }
    }

    public void generateJsonSchema(SchemaOutputResolver outputResolver, Class rootClass) {
        JsonSchemaGenerator generator = new JsonSchemaGenerator(this, this.contextState.properties);
        JsonSchema schema = generator.generateSchema(rootClass);
        try {
            Marshaller m = getJsonSchemaMarshaller();
            m.marshal(schema, outputResolver.createOutput(null, rootClass.getName() + ".json"));
        } catch (Exception ex) {
            throw org.eclipse.persistence.exceptions.JAXBException.exceptionDuringSchemaGeneration(ex);
View Full Code Here

Examples of org.eclipse.persistence.internal.jaxb.json.schema.JsonSchemaGenerator

            generateSchema(outputResolver, null);
        }
    }

    public void generateJsonSchema(SchemaOutputResolver outputResolver, Class rootClass) {
        JsonSchemaGenerator generator = new JsonSchemaGenerator(this.contextState.getXMLContext(), this.contextState.properties);
        JsonSchema schema = generator.generateSchema(rootClass);
        try {
            Marshaller m = getJsonSchemaMarshaller();
            m.marshal(schema, outputResolver.createOutput(null, rootClass.getName() + ".json"));
        } catch (Exception ex) {
            throw org.eclipse.persistence.exceptions.JAXBException.exceptionDuringSchemaGeneration(ex);
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.