Skip to content

Commit

Permalink
MODLD-604: Remove unwanted x-okapi-tenant parameter from controller m…
Browse files Browse the repository at this point in the history
…ethods
  • Loading branch information
pkjacob committed Jan 21, 2025
1 parent 0257b6f commit 70dff0f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AuthorityAssignmentController implements AuthorityApi {
private final ResourceMarcAuthorityService resourceMarcAuthorityService;

@Override
public ResponseEntity<String> authorityAssignmentCheck(String okapiTenant, AssignmentCheckDto dto) {
public ResponseEntity<String> authorityAssignmentCheck(AssignmentCheckDto dto) {
return ok(String.valueOf(
resourceMarcAuthorityService.isMarcAuthorityCompatibleWithTarget(
dto.getRawMarc(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ReindexingController implements ReindexApi {
private final ReindexService reIndexService;

@Override
public ResponseEntity<Void> reindex(String okapiTenant, Boolean full) {
public ResponseEntity<Void> reindex(Boolean full) {
reIndexService.reindexWorks(full);
return ResponseEntity.noContent().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ public class ResourceController implements ResourceApi {
private final ResourceMarcBibService resourceMarcService;

@Override
public ResponseEntity<ResourceResponseDto> createResource(String okapiTenant, @Valid ResourceRequestDto resourceDto) {
public ResponseEntity<ResourceResponseDto> createResource(@Valid ResourceRequestDto resourceDto) {
return ResponseEntity.ok(resourceService.createResource(resourceDto));
}

@Override
public ResponseEntity<ResourceResponseDto> getResourceById(Long id, String okapiTenant) {
public ResponseEntity<ResourceResponseDto> getResourceById(Long id) {
return ResponseEntity.ok(resourceService.getResourceById(id));
}

@Override
public ResponseEntity<ResourceIdDto> getResourceIdByResourceInventoryId(String inventoryId, String okapiTenant) {
public ResponseEntity<ResourceIdDto> getResourceIdByResourceInventoryId(String inventoryId) {
return ResponseEntity.ok(resourceService.getResourceIdByInventoryId(inventoryId));
}

Expand All @@ -59,19 +59,18 @@ public ResponseEntity<ResourceIdDto> importMarcRecord(String inventoryId) {
}

@Override
public ResponseEntity<ResourceResponseDto> updateResource(Long id, String okapiTenant,
@Valid ResourceRequestDto resourceDto) {
public ResponseEntity<ResourceResponseDto> updateResource(Long id, @Valid ResourceRequestDto resourceDto) {
return ResponseEntity.ok(resourceService.updateResource(id, resourceDto));
}

@Override
public ResponseEntity<Void> deleteResource(Long id, String okapiTenant) {
public ResponseEntity<Void> deleteResource(Long id) {
resourceService.deleteResource(id);
return ResponseEntity.noContent().build();
}

@Override
public ResponseEntity<ResourceMarcViewDto> getResourceMarcViewById(Long id, String okapiTenant) {
public ResponseEntity<ResourceMarcViewDto> getResourceMarcViewById(Long id) {
return ResponseEntity.ok(resourceMarcService.getResourceMarcView(id));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ResourceGraphController implements GraphApi {
private final ResourceGraphService resourceGraphService;

@Override
public ResponseEntity<ResourceGraphDto> getResourceGraphById(Long id, String okapiTenant) {
public ResponseEntity<ResourceGraphDto> getResourceGraphById(Long id) {
return ResponseEntity.ok(resourceGraphService.getResourceGraph(id));
}
}
17 changes: 0 additions & 17 deletions src/main/resources/swagger.api/mod-linked-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ paths:
- reindex
description: Start the process of reindexing of resources in the database
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/full'
responses:
'204':
Expand All @@ -28,8 +27,6 @@ paths:
tags:
- resource
description: Create a Resource
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
requestBody:
content:
application/json:
Expand All @@ -54,7 +51,6 @@ paths:
- resource
description: Get a resource by id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/id'
responses:
'200':
Expand All @@ -75,7 +71,6 @@ paths:
- resource
description: Update a resource by id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/id'
requestBody:
content:
Expand All @@ -102,7 +97,6 @@ paths:
- resource
description: Delete a resource by id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/id'
responses:
'204':
Expand All @@ -119,7 +113,6 @@ paths:
- resource
description: Get a marc view of resource by id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/id'
responses:
'200':
Expand All @@ -142,7 +135,6 @@ paths:
- resource
description: Get id of a resource by its inventory id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/inventoryId'
responses:
'200':
Expand Down Expand Up @@ -243,7 +235,6 @@ paths:
- graph
description: Get a resource graph by id
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
- $ref: '#/components/parameters/id'
responses:
'200':
Expand All @@ -265,8 +256,6 @@ paths:
tags:
- authority
description: Checks if authority can be assigned to work
parameters:
- $ref: '#/components/parameters/x-okapi-tenant-header'
requestBody:
content:
application/json:
Expand Down Expand Up @@ -302,12 +291,6 @@ components:
description: Linked Data resource inventory id
schema:
type: string
x-okapi-tenant-header:
name: x-okapi-tenant
in: header
description: X-Okapi-Tenant header value
schema:
type: string
full:
name: full
in: query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
@ExtendWith(MockitoExtension.class)
class ResourceControllerTest {

private static final String OKAPI_TENANT = "okapiTenant";

@InjectMocks
ResourceController resourceController;
@Mock
Expand All @@ -37,7 +35,7 @@ void getResourceMarcViewById_shouldReturnOkResponse() {
.thenReturn(expectedDto);

//when
var response = resourceController.getResourceMarcViewById(id, OKAPI_TENANT);
var response = resourceController.getResourceMarcViewById(id);

//then
assertThat(response)
Expand Down

0 comments on commit 70dff0f

Please sign in to comment.