Skip to content

Commit

Permalink
fix(api): remove deprecated timestamp query parameter from...
Browse files Browse the repository at this point in the history
...bundle and codesystem get by id endpoints.

Use `@timestamp` suffix to fetch a point-in-time version of the
resource.
  • Loading branch information
cmark committed Sep 24, 2023
1 parent 6693bf6 commit 336eba6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,13 @@ public Promise<Bundle> get(
@PathVariable(value="bundleId", required = true)
final String bundleId,

@Parameter(description = "The timestamp to use for historical ('as of') queries", deprecated = true)
final Long timestamp,

@ParameterObject
final ResourceSelectors selectors) {

return ResourceRequests.bundles().prepareGet(bundleId.contains(RevisionIndex.AT_CHAR) || timestamp == null ? Bundle.uri(bundleId) : Bundle.uri(bundleId).withTimestampPart(RevisionIndex.AT_CHAR + timestamp))
return ResourceRequests.bundles().prepareGet(Bundle.uri(bundleId))
.setExpand(selectors.getExpand())
.setFields(selectors.getField())
.buildAsync(timestamp)
.buildAsync()
.execute(getBus());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.springframework.web.bind.annotation.*;

import com.b2international.commons.exceptions.NotFoundException;
import com.b2international.index.revision.RevisionIndex;
import com.b2international.snowowl.core.codesystem.CodeSystem;
import com.b2international.snowowl.core.codesystem.CodeSystemRequests;
import com.b2international.snowowl.core.codesystem.CodeSystems;
Expand Down Expand Up @@ -117,13 +116,10 @@ public Promise<CodeSystem> get(
@PathVariable(value="codeSystemId", required = true)
final String codeSystemId,

@Parameter(description = "The timestamp to use for historical ('as of') queries", deprecated = true)
final Long timestamp,

@ParameterObject
final ResourceSelectors selectors) {

return CodeSystemRequests.prepareGetCodeSystem(codeSystemId.contains(RevisionIndex.AT_CHAR) || timestamp == null ? CodeSystem.uri(codeSystemId) : CodeSystem.uri(codeSystemId).withTimestampPart(RevisionIndex.AT_CHAR + timestamp))
return CodeSystemRequests.prepareGetCodeSystem(CodeSystem.uri(codeSystemId))
.setExpand(selectors.getExpand())
.setFields(selectors.getField())
.buildAsync()
Expand Down

0 comments on commit 336eba6

Please sign in to comment.