public StringSchema stringSchema() { return new StringSchema(); } }
public StringSchema stringSchema() { return new StringSchema(); } }
private void replaceDateTime(JsonSchema schema, Class<?> clazz) { Field[] fields = ClazzFieldFinder.getAllFields(clazz); for (Field field : fields) { String fieldName = field.getName(); if (field.getType().equals(DateTime.class)) { schema.asObjectSchema().getProperties().remove(fieldName); StringSchema stringSchemaDateTime = new StringSchema(); stringSchemaDateTime.setFormat(JsonValueFormat.DATE_TIME); schema.asObjectSchema().getProperties().put(fieldName, stringSchemaDateTime); } } }
public SalesforceMetadataRetrievalTest() { final Map<String, JsonSchema> objectProperties = new HashMap<>(); objectProperties.put("simpleProperty", new StringSchema()); objectProperties.put("anotherProperty", new NumberSchema()); final StringSchema uniqueProperty1 = new StringSchema(); uniqueProperty1.setDescription("idLookup,autoNumber"); uniqueProperty1.setTitle("Unique property 1"); final StringSchema uniqueProperty2 = new StringSchema(); uniqueProperty2.setDescription("calculated,idLookup"); uniqueProperty2.setTitle("Unique property 2"); objectProperties.put("uniqueProperty1", uniqueProperty1); objectProperties.put("uniqueProperty2", uniqueProperty2); final ObjectSchema objectSchema = new ObjectSchema(); objectSchema.setId("urn:jsonschema:org:apache:camel:component:salesforce:dto:SimpleObject"); objectSchema.setProperties(objectProperties); payload = new ObjectSchema(); payload.setOneOf(Collections.singleton(objectSchema)); }
result = booleanSchema; } else if ("string".equals(type) || "date".equals(type)) { StringSchema stringSchema = new StringSchema(); stringSchema.setTitle(name); result = stringSchema;
result = booleanSchema; } else if ("string".equals(type) || "date".equals(type)) { StringSchema stringSchema = new StringSchema(); stringSchema.setTitle(name); result = stringSchema;
result = booleanSchema; } else if ("string".equals(type) || "date".equals(type)) { StringSchema stringSchema = new StringSchema(); stringSchema.setTitle(name); result = stringSchema;
result = booleanSchema; } else if ("string".equals(type) || "date".equals(type)) { StringSchema stringSchema = new StringSchema(); stringSchema.setTitle(name); result = stringSchema;
result = booleanSchema; } else if ("string".equals(type) || "date".equals(type)) { StringSchema stringSchema = new StringSchema(); stringSchema.setTitle(name); result = stringSchema;
/** * Create a schema which verifies only that an object is of the given format. * @param format the format to expect * @return the schema verifying the given format */ public static JsonSchema minimalForFormat(JsonFormatTypes format) { if (format != null) { switch (format) { case ARRAY: return new ArraySchema(); case OBJECT: return new ObjectSchema(); case BOOLEAN: return new BooleanSchema(); case INTEGER: return new IntegerSchema(); case NUMBER: return new NumberSchema(); case STRING: return new StringSchema(); case NULL: return new NullSchema(); case ANY: default: } } return new AnySchema(); }
/** * Create a schema which verifies only that an object is of the given format. * @param format the format to expect * @return the schema verifying the given format */ public static JsonSchema minimalForFormat(JsonFormatTypes format) { if (format != null) { switch (format) { case ARRAY: return new ArraySchema(); case OBJECT: return new ObjectSchema(); case BOOLEAN: return new BooleanSchema(); case INTEGER: return new IntegerSchema(); case NUMBER: return new NumberSchema(); case STRING: return new StringSchema(); case NULL: return new NullSchema(); case ANY: default: } } return new AnySchema(); }
StringSchema sendAddressProperty = new StringSchema(); sendAddressProperty.setDescription("Addresses which the bound application will have permission to send to"); sendAddressProperty.setRequired(false); sendAddressProperty.setDefault("*"); StringSchema receiveAddressProperty = new StringSchema(); receiveAddressProperty.setDescription("Addresses which the bound application will have permission to receive from"); receiveAddressProperty.setRequired(false); ServiceBindingSchema bindSchema = new ServiceBindingSchema(bindParametersSchema); ObjectSchema serviceCreateParameters = new ObjectSchema(); StringSchema instanceNameProperty = new StringSchema(); instanceNameProperty.setDescription("The name of the address space to create"); instanceNameProperty.setRequired(true);