public void processDefinitions() { final Map<String, Model> definitions = swagger.getDefinitions(); if (definitions == null) { return; } Set<String> keySet = new LinkedHashSet<>(); // the definitions can grow as we resolve references while(definitions.keySet().size() > keySet.size()) { processDefinitions(keySet, definitions); } }
public SwaggerResolver(Swagger swagger, List<AuthorizationValue> auths, String parentFileLocation, Settings settings) { this.swagger = swagger; this.settings = settings != null ? settings : new Settings(); this.cache = new ResolverCache(swagger, auths, parentFileLocation); definitionsProcessor = new DefinitionsProcessor(cache, swagger); pathProcessor = new PathsProcessor(cache, swagger, this.settings); operationsProcessor = new OperationProcessor(cache, swagger); }
public Swagger resolve() { if (swagger == null) { return null; } pathProcessor.processPaths(); definitionsProcessor.processDefinitions(); if(swagger.getPaths() != null) { for(String pathname : swagger.getPaths().keySet()) { Path path = swagger.getPaths().get(pathname); if(path.getOperations() != null) { for(Operation operation : path.getOperations()) { operationsProcessor.processOperation(operation); } } } } return swagger; }