Commit 2a519253 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

documentation for list of formats API call

parent 938d2ae9
= Rest API Documentation - Converter
Piotr Gawron
v{project-version} {build-time}
:toc: left
:sectnums:
Conversion API provides access to MINERVA’s ability convert between different systems biology network formats and to export of layouts to different graphical formats.
== Conversion to systems biology formats
=== List available formats
==== CURL sample
include::{snippets}/converter/list_formats/curl-request.adoc[]
==== Response Fields
include::{snippets}/converter/list_formats/response-fields.adoc[]
==== Sample Response
include::{snippets}/converter/list_formats/response-body.adoc[]
package lcsb.mapviewer.web; package lcsb.mapviewer.web;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
...@@ -97,4 +101,26 @@ public class ConvertControllerIntegrationTest extends ControllerIntegrationTest ...@@ -97,4 +101,26 @@ public class ConvertControllerIntegrationTest extends ControllerIntegrationTest
assertEquals(1, s3); assertEquals(1, s3);
} }
@Test
public void testListAvailableFormats() throws Exception {
RequestBuilder request = get("/convert/");
mockMvc.perform(request)
.andExpect(status().is2xxSuccessful())
.andDo(document("converter/list_formats",
responseFields(
fieldWithPath("inputs")
.description("list of available input formats")
.type("Array"),
fieldWithPath("inputs[].available_names")
.description("list of names that could be used for specific format")
.type("Array<String>"),
fieldWithPath("outputs")
.description("list of available input formats")
.type("Array"),
fieldWithPath("outputs[].available_names")
.description("list of names that could be used for specific format")
.type("Array<String>"))));
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment