swagger: fixed invalid specification (#5485)
Currently, the swagger spec doesn't follow the Swagger 2.0 specification. So, I facing 4 errors when trying generate the Golang client for chatwoot. Due to the spec, the binary field should use format: binary beside type: string Signed-off-by: Giau. Tran Minh <hello@giautm.dev> Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -102,8 +102,8 @@ jobs:
|
|||||||
echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'."
|
echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar > ~/tmp/openapi-generator-cli-5.3.0.jar
|
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar > ~/tmp/openapi-generator-cli-6.3.0.jar
|
||||||
java -jar ~/tmp/openapi-generator-cli-5.3.0.jar validate -i swagger/swagger.json
|
java -jar ~/tmp/openapi-generator-cli-6.3.0.jar validate -i swagger/swagger.json
|
||||||
|
|
||||||
# Database setup
|
# Database setup
|
||||||
- run: yarn install --check-files
|
- run: yarn install --check-files
|
||||||
|
|||||||
@@ -158,13 +158,6 @@ conversation_status_toggle:
|
|||||||
conversation_labels:
|
conversation_labels:
|
||||||
$ref: ./resource/extension/conversation/labels.yml
|
$ref: ./resource/extension/conversation/labels.yml
|
||||||
|
|
||||||
## message
|
|
||||||
extended_message:
|
|
||||||
allOf:
|
|
||||||
- $ref: '#/definitions/generic_id'
|
|
||||||
- $ref: '#/definitions/message'
|
|
||||||
- $ref: ./resource/extension/message/with_source_sender.yml
|
|
||||||
|
|
||||||
|
|
||||||
## report
|
## report
|
||||||
account_summary:
|
account_summary:
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ properties:
|
|||||||
type: string
|
type: string
|
||||||
description: phone number of the contact
|
description: phone number of the contact
|
||||||
avatar:
|
avatar:
|
||||||
type: string <binary>
|
type: string
|
||||||
|
format: binary
|
||||||
description: Send the form data with the avatar image binary or use the avatar_url
|
description: Send the form data with the avatar image binary or use the avatar_url
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ properties:
|
|||||||
type: string
|
type: string
|
||||||
description: phone number of the contact
|
description: phone number of the contact
|
||||||
avatar:
|
avatar:
|
||||||
type: string <binary>
|
type: string
|
||||||
|
format: binary
|
||||||
description: Send the form data with the avatar image binary or use the avatar_url
|
description: Send the form data with the avatar image binary or use the avatar_url
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
type: object
|
type: object
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/generic_id'
|
|
||||||
- $ref: '#/definitions/conversation'
|
- $ref: '#/definitions/conversation'
|
||||||
- $ref: '../contact/conversation.yml'
|
- $ref: '../contact/conversation.yml'
|
||||||
|
|||||||
@@ -2,5 +2,3 @@ type: object
|
|||||||
properties:
|
properties:
|
||||||
source_id:
|
source_id:
|
||||||
type: number
|
type: number
|
||||||
sender:
|
|
||||||
type: object
|
|
||||||
|
|||||||
@@ -5688,7 +5688,8 @@
|
|||||||
"description": "phone number of the contact"
|
"description": "phone number of the contact"
|
||||||
},
|
},
|
||||||
"avatar": {
|
"avatar": {
|
||||||
"type": "string <binary>",
|
"type": "string",
|
||||||
|
"format": "binary",
|
||||||
"description": "Send the form data with the avatar image binary or use the avatar_url"
|
"description": "Send the form data with the avatar image binary or use the avatar_url"
|
||||||
},
|
},
|
||||||
"avatar_url": {
|
"avatar_url": {
|
||||||
@@ -5721,7 +5722,8 @@
|
|||||||
"description": "phone number of the contact"
|
"description": "phone number of the contact"
|
||||||
},
|
},
|
||||||
"avatar": {
|
"avatar": {
|
||||||
"type": "string <binary>",
|
"type": "string",
|
||||||
|
"format": "binary",
|
||||||
"description": "Send the form data with the avatar image binary or use the avatar_url"
|
"description": "Send the form data with the avatar image binary or use the avatar_url"
|
||||||
},
|
},
|
||||||
"avatar_url": {
|
"avatar_url": {
|
||||||
@@ -6157,9 +6159,6 @@
|
|||||||
"conversation_show": {
|
"conversation_show": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
|
||||||
"$ref": "#/definitions/generic_id"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/conversation"
|
"$ref": "#/definitions/conversation"
|
||||||
},
|
},
|
||||||
@@ -6237,27 +6236,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extended_message": {
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/generic_id"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/message"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"source_id": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"sender": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"account_summary": {
|
"account_summary": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
Reference in New Issue
Block a user