Skip to content

Commit

Permalink
Merge pull request #14219 from rubhanazeem/document-status-messages
Browse files Browse the repository at this point in the history
OpenAPI specifications for POST status/messages
  • Loading branch information
eduardoj committed Apr 25, 2023
2 parents 6b1c541 + 93e95d2 commit 6a830c6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: |
Status message no permission.
XML Schema used for body validation: [status.xsd](../schema/status.xsd)
content:
application/xml; charset=utf-8:
schema:
$ref: '../schemas/api_response.yaml'
examples:
status message no permission:
value:
code: put_request_no_permission
summary: "Requires admin privileges"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Bad request. Validation Error
content:
application/xml; charset=utf-8:
schema:
$ref: '../schemas/api_response.yaml'
examples:
Validation Failed:
value:
code: validation_failed
summary: "status_message validation error: 2:0: ERROR: Element '<some element>': No matching global declaration available for the validation root."
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ properties:
type: string
created_at:
type: string
xml:
name: status_message
33 changes: 33 additions & 0 deletions src/api/public/apidocs-new/paths/status_messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,36 @@ get:
$ref: '../components/responses/unauthorized.yaml'
tags:
- Status Messages

post:
summary: Create a status message
description: |
Create a new status message (Only admins are allowed to add status messages).
Possible values for severity: (information, green, yellow, red, announcement).
Possible values for scope: (all_users, logged_in_users, admin_users, in_beta_users, in_rollout_users)
security:
- basic_authentication: []
requestBody:
description: Attributes for status message
required: true
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/status_message.yaml'
example:
message: Feature number 42 was implemented!
severity: announcement
scope: all_users
responses:
'200':
$ref: '../components/responses/succeeded.yaml'
'400':
$ref: '../components/responses/validation_error.yaml'
'401':
$ref: '../components/responses/unauthorized.yaml'
'403':
$ref: '../components/responses/status_message_no_permission.yaml'
tags:
- Status Messages

0 comments on commit 6a830c6

Please sign in to comment.