XSDImportResource extends GenericImportResource { @GET @Path("alldeclaredelementslocalnames") public List<String> getAllDeclaredElementsLocalNames() { return RepositoryFactory.getRepository().getXsdImportManager().getAllDeclaredElementsLocalNames().stream() .filter(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getNamespace().equals(id.getNamespace())) .flatMap(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getDefinedLocalNames().stream()) .sorted() .collect(Collectors.toList()); } XSDImportResource(XSDImportId id); @GET @ApiOperation(value = "May be used by the modeler to generate an XML editor based on the XML schema") // we cannot use "MimeTypes.MIMETYPE_XSD" here as the latter is "text/xml" and org.eclipse.winery.repository.resources.AbstractComponentInstanceResource.getDefinitionsAsResponse() also produces text/xml @Produces("text/xsd") Response getXSD(); @GET @Path("alldeclaredelementslocalnames") List<String> getAllDeclaredElementsLocalNames(); @GET @Path("alldefinedtypeslocalnames") List<String> getAllDefinedTypesLocalNames();  }
@Test public void getAllDeclaredElementsLocalNames() throws Exception { this.setRevisionTo("b827889c9a3e2e2af338190a66f6e61ab284fbf1"); this.assertGet("imports/http%253A%252F%252Fwww.w3.org%252F2001%252FXMLSchema/https%253A%252F%252Fwww.w3schools.com%252Fxml%252Fschema_example.asp/ShipOrderProperties/alldeclaredelementslocalnames", "imports/w3c_schema_example_all_declared_elements_local_names.json"); }