DM openapi call error

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: DM openapi调用错误

| username: TiDBer_hwEZA4rV

According to the official documentation, the error encountered when calling the interface is as follows:
cat test.sh
curl -X ‘POST’
http://192.168.85.30:8261/api/v1/sources
-H ‘accept: application/json’
-H ‘Content-Type: application/json’
-d ‘{
“source_name”: “mysqlmigrate”,
“host”: “192.168.100.17”,
“port”: 3306,
“user”: “otter”,
“password”: “otter”,
“enable”: true,
“enable_gtid”: false,
“security”: {
“ssl_ca_content”: “”,
“ssl_cert_content”: “”,
“ssl_key_content”: “”,
“cert_allowed_cn”: [
“string”
]
},
“purge”: {
“interval”: 3600,
“expires”: 0,
“remain_space”: 15
}
}’
[admin@mysql-dm]$ sh test.sh
{“error”:“error in openapi3filter.RequestError: request body has an error: doesn’t match the schema: Error at "/source": property "source" is missing”}[admin@mysql dm]$

| username: lance6716 | Original post link

Sorry, the documentation is incorrect, it is missing a layer “source”. Please refer to the correct one:

Could you help us update the documentation? After switching to the dev version of the documentation, a “Edit this page” option will appear in the upper right corner.