Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Adding mime type for geojson
- Add "when" parameter in a few GET API endpoints to enable pagination [#266](https://github.com/clowder-framework/clowder/issues/266)
- Add "id" in GET metadata.jsonld endpoints [#278](https://github.com/clowder-framework/clowder/issues/278)

## 1.18.1 - 2021-08-16

Expand Down
3 changes: 2 additions & 1 deletion app/util/JSONLD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ object JSONLD {
)

//convert metadata to json using implicit writes in Metadata model
val metadataJson = resourceJson ++ toJson(metadata).asInstanceOf[JsObject]
//include metadata ID in the json
val metadataJson = JsObject(Seq("id" -> JsString(metadata.id.toString()))) ++ resourceJson ++ toJson(metadata).asInstanceOf[JsObject]

//combine the two json objects and return
if (contextJson.isEmpty) metadataJson else contextJson.get ++ metadataJson
Expand Down