Skip to content

Commit

Permalink
Merge branch '923-default' of https://github.com/hbz/lobid-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg authored and sol committed Sep 21, 2018
2 parents f1b5e02 + bc5161a commit 33db06d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/app/controllers/resources/Accept.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private Accept() {
}

enum Format {
BULK("jsonl", "application/x-jsonlines"), //
JSON_LD("json(.+)?", "application/json", "application/ld+json"), //
BULK("jsonl", "application/x-jsonlines"), //
HTML("html", "text/html"), //
RDF_XML("rdf", "application/rdf+xml", "application/xml", "text/xml"), //
N_TRIPLE("nt", "application/n-triples", "text/plain"), //
Expand Down
3 changes: 3 additions & 0 deletions web/test/tests/AcceptIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {
// search, default format: JSON
{ fakeRequest(GET, "/resources/search?q=*"), /*->*/ "application/json" },
{ fakeRequest(GET, "/resources/search?q=*").header("Accept", "*/*"), /*->*/ "application/json" },
{ fakeRequest(GET, "/resources/search?q=*").header("Accept", "application/x-jsonlines"), /*->*/ "application/x-jsonlines" },
{ fakeRequest(GET, "/resources/search?q=*&format="), /*->*/ "application/json" },
{ fakeRequest(GET, "/resources/search?q=*&format=json"), /*->*/ "application/json" },
{ fakeRequest(GET, "/resources/search?q=*&format=jsonl"), /*->*/ "application/x-jsonlines" },
{ fakeRequest(GET, "/resources/search?q=*&format=whatever"), /*->*/ "application/json" },
{ fakeRequest(GET, "/resources/search?q=*").header("Accept", "text/plain"), /*->*/ "application/json" },
// search, others formats as query param:
Expand Down

0 comments on commit 33db06d

Please sign in to comment.