Skip to content

Commit

Permalink
change error messages to RFC7807 format
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahuljagwani committed Jun 2, 2024
1 parent 92b03b0 commit 4ea8b3a
Showing 1 changed file with 45 additions and 48 deletions.
93 changes: 45 additions & 48 deletions crate_db/api/crate_db_specs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
openapi: "3.1.0"
openapi: 3.1.0
info:
title: "OpenAPI specification for managing RO-Crates"
description: "Microservice for managing RO-Crates"
version: "0.1.0"
version: 0.1.0
servers:
- url: /elixircloud/roc/v1

Expand Down Expand Up @@ -123,7 +123,7 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/ROCrateResponse'
$ref: '#/components/schemas/CreateROCResponse'
400:
$ref: '#/components/responses/BadRequest'
401:
Expand Down Expand Up @@ -154,7 +154,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ROCrateResponse'
$ref: '#/components/schemas/CreateROCResponse'
400:
$ref: '#/components/responses/BadRequest'
401:
Expand Down Expand Up @@ -184,7 +184,7 @@ paths:
multipart/form-data:
schema:
x-body-name: updateROCRequestBody
$ref: '#/components/schemas/UpdateROCRequestBody'
$ref: '#/components/schemas/CreateROCResponse'
responses:
204:
description: No Content
Expand Down Expand Up @@ -326,14 +326,6 @@ components:
format: uuid
description: The unique identifier for the RO-Crate.
example: 260e7aa0-2e07-484e-9da7-ee19fdd1800d

ROCrateResponse:
type: object
properties:
_id:
type: string
description: The unique identifier for the RO-Crate.
example: 60b6c0f9f1d2c12a5c7d6b8e
rocrate:
type: string
description: The link to the RO-Crate file in MinIO.
Expand Down Expand Up @@ -376,71 +368,76 @@ components:
- title
- description

ProblemDetails:
type: object
properties:
type:
type: string
format: uri
description: A URI reference that identifies the problem type. When dereferenced, it might provide human-readable documentation for the problem type.
title:
type: string
description: A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for localization purposes.
status:
type: integer
format: int32
description: The HTTP status code generated by the origin server for this occurrence of the problem.
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
format: uri
description: A URI reference that identifies the specific occurrence of the problem. It might provide further information if dereferenced.
code:
type: integer
format: int32
description: Application-specific error code.
message:
type: string
description: A detailed error message.

required:
- type
- title
- status
- detail

responses:
BadRequest:
description: Bad Request
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
$ref: '#/components/schemas/ProblemDetails'

Unauthorized:
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
$ref: '#/components/schemas/ProblemDetails'

Forbidden:
description: Forbidden
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
$ref: '#/components/schemas/ProblemDetails'

NotFound:
description: Resource Not Found
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
$ref: '#/components/schemas/ProblemDetails'

UnexpectedError:
description: Unexpected Error
content:
application/json:
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
$ref: '#/components/schemas/ProblemDetails'

parameters:
roc-id:
Expand Down

0 comments on commit 4ea8b3a

Please sign in to comment.