feat: Update swagger to openapi 3.0.4, update request payloads with examples (#11533)

# Pull Request Template

## Description

Updates the public swagger spec to be OpenAPI 3.0.4 compliant. Regarding
#7893, I'm investigating the use of
[oas_rails](https://github.com/a-chacon/oas_rails) to auto-generate the
documentation along with correct expected payloads.
Mostly fixes #10531, related to #7893

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Copied spec into swagger editor, reviewed outputs:

![openapi](https://github.com/user-attachments/assets/bd43f895-74bb-4373-ba6d-c5b190b699dd)

Note that this shows two errors with the `DELETE` endpoints as
technically these should not have a `requestBody` - in which case we
should be making use of another HTTP verb or another endpoint.

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Daniel Jimenez <devildan.knex@gmail.com>
Co-authored-by: Daniel Jimenez <daniel.jimenez@spark64.com>
This commit is contained in:
Tanmay Deep Sharma
2025-05-22 17:57:12 +07:00
committed by GitHub
parent 99de5f4257
commit 459f225559
70 changed files with 28448 additions and 557 deletions

View File

@@ -0,0 +1,47 @@
type: object
properties:
id:
type: number
description: The ID of the message
content:
type: string
description: The text content of the message
inbox_id:
type: number
description: The ID of the inbox
conversation_id:
type: number
description: The ID of the conversation
message_type:
type: integer
enum: [0, 1, 2, 3]
description: "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
content_type:
type: string
enum: ["text", "input_select", "cards", "form", "input_csat"]
description: The type of the message content
status:
type: string
enum: ["sent", "delivered", "read", "failed"]
description: The status of the message
content_attributes:
type: object
description: The content attributes for each content_type
properties:
in_reply_to:
type: string
description: ID of the message this is replying to
nullable: true
created_at:
type: integer
description: The timestamp when message was created
private:
type: boolean
description: The flag which shows whether the message is private or not
source_id:
type: string
description: The source ID of the message
nullable: true
sender:
$ref: '#/components/schemas/contact_detail'
description: The sender of the message (only for incoming messages)