Skip to content

Commit

Permalink
fix: Avoid oneOf usage in Open API 2.0 spec (chatwoot#8819)
Browse files Browse the repository at this point in the history
Small fixes to make spec adhere to swagger 2.0
  • Loading branch information
gsemyong authored Jan 31, 2024
1 parent 17cb788 commit 53d42b1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 47 deletions.
18 changes: 2 additions & 16 deletions swagger/definitions/request/public/message/update_payload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,5 @@
type: object
properties:
submitted_values:
oneOf:
- type: object
description: Replies to the Bot Message Types
properties:
csat_survey_response:
type: object
description: CSAT Survey Response if original message is CSAT Survey
properties:
rating:
type: integer
description: CSAT Rating
example: 5
feedback_message:
type: string
description: CSAT Comment
example: 'Great'
type: object
description: Replies to the Bot Message Types
3 changes: 3 additions & 0 deletions swagger/parameters/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ public_inbox_identifier:

public_contact_identifier:
$ref: ./public/contact_identifier.yml

portal_id:
$ref: ./portal_id.yml
2 changes: 1 addition & 1 deletion swagger/paths/application/contacts/filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ parameters:
query_operator:
type: string
description: query operator name
enum: [ AND, OR ]
enum: [ AND, OR ]
example:
- attribute_key: 'name'
filter_operator: 'equal_to'
Expand Down
45 changes: 15 additions & 30 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2154,12 +2154,12 @@
},
"query_operator": {
"type": "string",
"description": "query operator name"
},
"enum": [
"AND",
"OR"
]
"description": "query operator name",
"enum": [
"AND",
"OR"
]
}
}
},
"example": [
Expand Down Expand Up @@ -6746,30 +6746,8 @@
"type": "object",
"properties": {
"submitted_values": {
"oneOf": [
{
"type": "object",
"description": "Replies to the Bot Message Types",
"properties": {
"csat_survey_response": {
"type": "object",
"description": "CSAT Survey Response if original message is CSAT Survey",
"properties": {
"rating": {
"type": "integer",
"description": "CSAT Rating",
"example": 5
},
"feedback_message": {
"type": "string",
"description": "CSAT Comment",
"example": "Great"
}
}
}
}
}
]
"type": "object",
"description": "Replies to the Bot Message Types"
}
}
},
Expand Down Expand Up @@ -7280,6 +7258,13 @@
"type": "string",
"required": true,
"description": "The source id of contact obtained on contact create"
},
"portal_id": {
"in": "path",
"name": "portal_id",
"type": "integer",
"required": true,
"description": "The numeric ID of the portal"
}
},
"x-tagGroups": [
Expand Down

0 comments on commit 53d42b1

Please sign in to comment.