Skip to content

Commit

Permalink
Merge pull request #283 from tanvi029/details_upd
Browse files Browse the repository at this point in the history
Detail field updated
  • Loading branch information
pranavrd authored Sep 29, 2023
2 parents a5d1bb5 + ccd9f1a commit 1a4adf0
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 39 deletions.
35 changes: 33 additions & 2 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ paths:
type: [ ]
name: wifi-location ...
title: 'urn:dx:cat:Success'
detail: 'Success: Item has been created successfully'

'400':
description: Invalid document
content:
Expand Down Expand Up @@ -747,6 +749,16 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/successResponseWithObjects'
example:
type: 'urn:dx:cat:Success'
title: Success
totalHits: 10
results:
- id: uuid
name: wifi-location
type:
- 'iudx:Resource'
details: 'Success: Item fetched successfully'
'400':
description: Invalid ID.
content:
Expand Down Expand Up @@ -802,6 +814,8 @@ paths:
title: Success
results:
- id: uuid
details: 'Success: Item has been deleted successfully'

'401':
description: Unauthorized access
content:
Expand Down Expand Up @@ -2157,9 +2171,9 @@ components:
id: cc18c925-8990-3a07-9cac-0bb2bd8166f6
itemStatus: ACTIVE
itemCreatedAt: 2023-09-08T10:00:02+0530





invalidIdErrorResponse:
type: object
title: Invalid ID
Expand Down Expand Up @@ -2199,13 +2213,18 @@ components:
description: Results which matched the query. This is an array of objects.
items:
type: object
detail:
type: string
description: Detailed description of the type or response

required:
- type
example:
type: 'urn:dx:cat:ItemNotFound'
title: error
totalHits: 0
results: [ ]
detail: 'doc does not exist'
exampleEntityWIdOwner:
type: object
title: owner entity
Expand Down Expand Up @@ -2618,6 +2637,10 @@ components:
description: Results which matched the query. This is an array of objects.
items:
type: object
detail:
type: string
description: Detailed description of the type or response

required:
- type
example:
Expand All @@ -2627,6 +2650,8 @@ components:
id: uuid
type: [ ]
name: wifi-location
details: 'Success: Item has been updated successfully'

errorInvalidSchema:
type: object
title: Response - invalid schema
Expand Down Expand Up @@ -2716,6 +2741,10 @@ components:
description: Results which matched the query. This is an array of objects.
items:
type: object
detail:
type: string
description: Detailed description of the type or response

description: Update Item Not Found
example:
type: urn:dx:cat:ItemNotFound
Expand All @@ -2725,6 +2754,8 @@ components:
method: update
title: failed
detail: 'Fail: Doc doesn''t exist, can''t update'
detail: 'Fail: Doc doesn''t exist, can''t update'

exampleEntityOwner:
type: object
title: owner entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public void getItemHandler(RoutingContext routingContext) {
JsonObject result = dbhandler.result();
result.put(STATUS, ERROR);
result.put(TYPE, TYPE_ITEM_NOT_FOUND);
dbhandler.result().put("detail", "doc doesn't exist");
response.setStatusCode(404)
.end(dbhandler.result().toString());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public void getLocation(RoutingContext routingContext) {
new RespBuilder()
.withType(TYPE_INVALID_SYNTAX)
.withTitle(TITLE_INVALID_SYNTAX)
.withDetail("Invalid Syntax")
.getResponse());
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/iudx/catalogue/server/apiserver/RatingApis.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public void createRatingHandler(RoutingContext routingContext) {
new RespBuilder()
.withType(TYPE_INVALID_SCHEMA)
.withTitle(TITLE_INVALID_SCHEMA)
.getResponse());
.withDetail("The Schema of requested body is invalid.")
.getResponse());
} else {
ratingService.createRating(
requestBody,
Expand Down Expand Up @@ -307,7 +308,8 @@ public void updateRatingHandler(RoutingContext routingContext) {
new RespBuilder()
.withType(TYPE_INVALID_SCHEMA)
.withTitle(TITLE_INVALID_SCHEMA)
.getResponse());
.withDetail("The Schema of requested body is invalid.")
.getResponse());
} else {
ratingService.updateRating(
requestBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public void listRelationshipHandler(RoutingContext routingContext) {
.end(new RespBuilder()
.withType(TYPE_INVALID_SYNTAX)
.withTitle(TITLE_INVALID_SYNTAX)
.getResponse());
.withDetail("Invalid Syntax")
.getResponse());
}
} else {
LOGGER.error("Fail: Issue in query parameter");
Expand Down Expand Up @@ -164,7 +165,8 @@ public void relSearchHandler(RoutingContext routingContext) {
.end(new RespBuilder()
.withType(TYPE_INVALID_SYNTAX)
.withTitle(TITLE_INVALID_SYNTAX)
.getResponse());
.withDetail("Invalid Syntax")
.getResponse());
}
} else {
LOGGER.error("Fail: Invalid request query parameters");
Expand All @@ -173,7 +175,8 @@ public void relSearchHandler(RoutingContext routingContext) {
.end(new RespBuilder()
.withType(TYPE_INVALID_SYNTAX)
.withTitle(TITLE_INVALID_SYNTAX)
.getResponse());
.withDetail("Invalid Syntax")
.getResponse());
}
}
}
Loading

0 comments on commit 1a4adf0

Please sign in to comment.