JsonConfigWriter implements ApiConfigWriter { @VisibleForTesting String addTypeToSchema(ObjectNode schemasNode, TypeToken<?> type, ApiConfig apiConfig, List<ApiParameterConfig> parameterConfigs) throws ApiConfigException { return addTypeToSchema(schemasNode, type, null, apiConfig, parameterConfigs); } JsonConfigWriter();  JsonConfigWriter(TypeLoader typeLoader, ApiConfigValidator validator); @Override Map<ApiKey, String> writeConfig(Iterable<? extends ApiConfig> configs); @Override String getFileExtension(); static final String MAP_SCHEMA_NAME; static final String ANY_SCHEMA_NAME; }
@Test public void testBeanPropertyDateType() throws Exception { ObjectMapper mapper = new ObjectMapper(); ObjectNode schemasConfig = mapper.createObjectNode(); writer.addTypeToSchema(schemasConfig, TypeToken.of(Bean.class), apiConfig, null); JsonNode beanConfig = schemasConfig.path("Bean"); assertEquals("Bean", beanConfig.path("id").asText()); assertEquals("object", beanConfig.path("type").asText()); assertEquals("string", beanConfig.path("properties").path("date").path("type").asText()); assertEquals("date-time", beanConfig.path("properties").path("date").path("format").asText()); }