Skip to content

Commit

Permalink
Separated enable hook errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcastrosilva committed Apr 25, 2022
1 parent b3db18b commit 6158eb4
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 38 deletions.
37 changes: 0 additions & 37 deletions openapi/components/examples/enableHook-fail.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>enableHookError</messageKey>
<message>An error happened while enabling your hook. Please contact the system's administrators.</message>
</response>
7 changes: 7 additions & 0 deletions openapi/components/examples/enableHook/enableHook-fail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>checksumError</messageKey>
<message>You did not pass the checksum security check</message>
</response>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>enableMissingHook</messageKey>
<message>The hook informed was not found or the shared secret didn't match the hook's.</message>
</response>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>invalidParamHookID</messageKey>
<message>You must specify a valid hookID in the parameters.</message>
</response>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail:
value: |-
<response>
<returncode>FAILED</returncode>
<messageKey>missingParamHookID</messageKey>
<message>You must specify a hookID in the parameters.</message>
</response>
15 changes: 15 additions & 0 deletions openapi/components/schemas/responses/enableHookError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
required:
- response
- messageKey
- message
properties:
response:
type: object
properties:
returncode:
type: string
messageKey:
type: string
message:
type: string
42 changes: 41 additions & 1 deletion openapi/paths/enable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,44 @@ get:
examples:
$ref: '../components/examples/enableHook/success.yaml'
schema:
$ref: '../components/schemas/responses/enableHook.yaml'
$ref: '../components/schemas/responses/enableHook.yaml'
'204':
description: Hook Not Found
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableHook-hookNotFoundError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'400':
description: Invalid Hook ID
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableHook-invalidHookIDError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'401':
description: Checksum test failed
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableHook-fail.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'422':
description: Missing Hook ID
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableHook-missingParamError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'
'500':
description: Couldn't enable hook
content:
application/xml:
examples:
$ref: '../components/examples/enableHook/enableHook-enableError.yaml'
schema:
$ref: '../components/schemas/responses/enableHookError.yaml'

0 comments on commit 6158eb4

Please sign in to comment.