Skip to content

Commit

Permalink
Merge pull request #47 from Systems-Modeling/feature/ST5AS-120
Browse files Browse the repository at this point in the history
ST5AS-120 Re-inline @context and respond with JSON (non-LD) by default
  • Loading branch information
ivan-gomes authored Mar 28, 2021
2 parents 878ee15 + a9831c1 commit 8bfb2ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/controllers/BaseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

public abstract class BaseController extends Controller {

protected static final boolean INLINE_JSON_LD_CONTEXT_DEFAULT = false;
protected static final boolean INLINE_JSON_LD_CONTEXT_DEFAULT = true;
protected static final boolean INLINE_JSON_LD_CONTEXT = Optional.ofNullable(System.getenv("INLINE_JSON_LD_CONTEXT"))
.map(Boolean::parseBoolean)
.orElse(INLINE_JSON_LD_CONTEXT_DEFAULT);
Expand Down Expand Up @@ -178,6 +178,6 @@ protected static JsonLdMofObjectAdornment adornMofObject(MofObject mof, Http.Req
}

protected static boolean respondWithJsonLd(Http.Request request) {
return request.accepts(JSONLD_MIME_TYPE);
return request.accepts(JSONLD_MIME_TYPE) && !request.accepts(Http.MimeTypes.JSON);
}
}
14 changes: 7 additions & 7 deletions public/swagger/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ paths:
operationId: getElementsByProjectCommit
summary: Get elements by project and commit
produces:
- application/ld+json
- application/json
- application/ld+json
responses:
200:
description: Ok
Expand Down Expand Up @@ -313,8 +313,8 @@ paths:
operationId: getElementByProjectCommitId
summary: Get element by project, commit and ID
produces:
- application/ld+json
- application/json
- application/ld+json
responses:
200:
description: Ok
Expand Down Expand Up @@ -364,8 +364,8 @@ paths:
operationId: getRootsByProjectCommit
summary: Get root elements by project and commit
produces:
- application/ld+json
- application/json
- application/ld+json
responses:
200:
description: Ok
Expand Down Expand Up @@ -433,8 +433,8 @@ paths:
operationId: getRelationshipsByProjectCommitRelatedElement
summary: Get relationships by project, commit, and related element
produces:
- application/ld+json
- application/json
- application/ld+json
responses:
200:
description: Ok
Expand Down Expand Up @@ -580,8 +580,8 @@ paths:
operationId: getQueryResultsByProjectIdQueryId
summary: Get query results by project and query
produces:
- application/ld+json
- application/json
- application/ld+json
responses:
200:
description: Ok
Expand Down Expand Up @@ -619,8 +619,8 @@ paths:
consumes:
- application/json
produces:
- application/ld+json
- application/json
- application/ld+json
parameters:
- in: body
name: body
Expand Down Expand Up @@ -651,8 +651,8 @@ paths:
consumes:
- application/json
produces:
- application/ld+json
- application/json
- application/ld+json
parameters:
- in: body
name: body
Expand Down

0 comments on commit 8bfb2ce

Please sign in to comment.