@Test public void shouldFindCyclicReferenceInOpenHabSwagger() throws IOException { final Oas20Document openApiDoc = (Oas20Document) Library.readDocumentFromJSONString(Resources.getResourceAsText("openapi/v2/openhab.json")); assertThat(CyclicValidationCheck.hasCyclicReferences(getSchemaDefinitions(openApiDoc))).isTrue(); }
static boolean hasCyclicReferences(final Map<String, ? extends OasSchema> schemaDefinitions) { if (schemaDefinitions.isEmpty()) { return false; } final Map<String, Set<String>> references = collectReferences(schemaDefinitions); return isCyclic(references); }
CyclicValidationCheck { static boolean hasCyclicReferences(final Map<String, ? extends OasSchema> schemaDefinitions) { if (schemaDefinitions.isEmpty()) { return false; } final Map<String, Set<String>> references = collectReferences(schemaDefinitions); return isCyclic(references); } }
CyclicValidationCheck { static boolean hasCyclicReferences(final Map<String, ? extends OasSchema> schemaDefinitions) { if (schemaDefinitions.isEmpty()) { return false; } final Map<String, Set<String>> references = collectReferences(schemaDefinitions); return isCyclic(references); } private  CyclicValidationCheck(); }
CyclicValidationCheck { static boolean hasCyclicReferences(final Map<String, ? extends OasSchema> schemaDefinitions) { if (schemaDefinitions.isEmpty()) { return false; } final Map<String, Set<String>> references = collectReferences(schemaDefinitions); return isCyclic(references); } private  CyclicValidationCheck();  }
CyclicValidationCheck { static boolean hasCyclicReferences(final Map<String, ? extends OasSchema> schemaDefinitions) { if (schemaDefinitions.isEmpty()) { return false; } final Map<String, Set<String>> references = collectReferences(schemaDefinitions); return isCyclic(references); } private  CyclicValidationCheck();   }