Skip to content

Commit

Permalink
Add convinient get endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pulledtim committed Sep 21, 2023
1 parent deb6e02 commit 079e28d
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 194 deletions.
24 changes: 22 additions & 2 deletions api/trusted-issuers-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- name: verfication
- name: issuer
paths:
/v4/issuers:
/issuer:
post:
tags:
- issuer
Expand Down Expand Up @@ -35,7 +35,27 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/v4/issuers/{did}:
/issuer/{did}:
get:
tags:
- issuer
parameters:
- $ref: '#/components/parameters/Id'
description: Get a single issuer
operationId: getIssuer
responses:
'200':
description: Successfully retrieved the issuer.
content:
application/json:
schema:
$ref: '#/components/schemas/TrustedIssuer'
'404':
description: No such issuer exists.
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
delete:
tags:
- issuer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ public HttpResponse<Object> deleteIssuerById(String did) {
return HttpResponse.noContent();
}

@Override
public HttpResponse<TrustedIssuerVO> getIssuer(String did) {
return trustedIssuerRepository
.getByDid(did)
.map(trustedIssuerMapper::map)
.map(HttpResponse::ok)
.orElseGet(HttpResponse::notFound);
}

@Override
public HttpResponse<TrustedIssuerVO> updateIssuer(String did, TrustedIssuerVO trustedIssuerVO) {
if (!trustedIssuerRepository.existsById(did)) {
Expand Down
Loading

0 comments on commit 079e28d

Please sign in to comment.