public Map<String, String> getConsolidatedSchemas() { //HYBRIS start - changed HashMap to LinkedHashMap Map<String, String> consolidated = new LinkedHashMap<String, String>(); //HYBRIS end for (Map<String, String> map : getSchemas()) { consolidated.putAll(map); } return consolidated; }
public Map<String, String> getConsolidatedSchemas() { Map<String, String> consolidated = new HashMap<String, String>(); for (Map<String, String> map : getSchemas()) { consolidated.putAll(map); } return consolidated; }
private void compileGlobalSchemas() { SchemaCompiler compiler = SchemaCompiler.getInstance(); Raml raml = getDocumentObject(); Map<String, Object> compiledSchemas = new HashMap<String, Object>(); List<Map<String, String>> schemas = raml.getSchemas(); for (Map<String, String> schemaMap : schemas) { compiledSchemas.putAll(compiler.compile(schemaMap)); } raml.setCompiledSchemas(compiledSchemas); }
@Override public void updateApi(String apiId, Raml raml, JSONObject config) { this.config = config; RestApi api = getApi(apiId); Optional<Resource> rootResource = getRootResource(api); createModels(api, raml.getSchemas(), true); createResources(api, createResourcePath(api, rootResource.get(), raml.getBasePath()), new HashMap<String, UriParameter>(), raml.getResources(), true); cleanupResources(api, this.paths); cleanupModels(api, this.models); }
public JSONSchemaStore(final Raml raml, final File globalSchemaStore, final Context context) throws IOException { Preconditions.checkNotNull(raml, "Given raml file should be not null"); this.ramlFile = raml; this.globalSchemaStore = globalSchemaStore == null ? Files.createTempDir() : globalSchemaStore; this.ramlSchemaStore = new File(this.globalSchemaStore, RAML_DIR); if (!this.ramlSchemaStore.mkdir()) { throw new IllegalArgumentException("Could not create RAML schemastore at " + ramlSchemaStore); } this.context = context; for (final Map.Entry<String, String> inlinedSchema : getAdjustedInlineSchemas().entrySet()) { raml.getSchemas().add(ImmutableMap.of(inlinedSchema.getKey(), inlinedSchema.getValue())); } assureSchemaGenerated(); // configure the JSON -> POJO generator final GenerationConfig jsonSchemaGenerationConfig = getDefaultGenerationConfig(); mappingDelegate = new MappingDelegate(context); final JSONRuleFactory hybrisJSONRuleFactory = new JSONRuleFactory(jsonSchemaGenerationConfig, new AnnotatorFactory().getAnnotator(jsonSchemaGenerationConfig.getAnnotationStyle()), new SchemaResolvingSchemaStore(), context, mappingDelegate); schemaMapper = new SchemaMapper(hybrisJSONRuleFactory, new SchemaGenerator()); assureSchemaLoaded(); }
@Override public String createApi(Raml raml, String name, JSONObject config) { this.config = config; // TODO: What to use as description? final RestApi api = createApi(getApiName(raml, name), null); LOG.info("Created API "+api.getId()); try { final Resource rootResource = getRootResource(api).get(); deleteDefaultModels(api); createModels(api, raml.getSchemas(), false); createResources(api, createResourcePath(api, rootResource, raml.getBasePath()), new HashMap<String, UriParameter>(), raml.getResources(), false); } catch (Throwable t) { LOG.error("Error creating API, rolling back", t); rollback(api); throw t; } return api.getId(); }
for (Map<String, String> schema : raml.getSchemas()) { for (Entry<String, String> entry : schema.entrySet()) { Representation representation = new Representation();
for (Map<String, String> schema : raml.getSchemas()) { for (Entry<String, String> entry : schema.entrySet()) { Representation representation = new Representation();
for (Map<String, String> schema : raml.getSchemas()) { for (Entry<String, String> entry : schema.entrySet()) { Representation representation = new Representation();
for (Map<String, String> schema : raml.getSchemas()) { for (Entry<String, String> entry : schema.entrySet()) { Representation representation = new Representation();
for (Map<String, String> schema : raml.getSchemas()) { for (Entry<String, String> entry : schema.entrySet()) { Representation representation = new Representation();
raml.getSchemas().add(schemas); for (Representation representation : contract.getRepresentations()) { if (RamlUtils.isPrimitiveType(representation.getName())) {
raml.getSchemas().add(schemas); for (Representation representation : contract.getRepresentations()) { if (RamlUtils.isPrimitiveType(representation.getName())) {
raml.getSchemas().add(schemas); for (Representation representation : contract.getRepresentations()) { if (RamlUtils.isPrimitiveType(representation.getName())) {
raml.getSchemas().add(schemas); for (Representation representation : contract.getRepresentations()) { if (RamlUtils.isPrimitiveType(representation.getName())) {
raml.getSchemas().add(schemas); for (Representation representation : contract.getRepresentations()) { if (RamlUtils.isPrimitiveType(representation.getName())) {