Cannot deserialize instance of java.lang.String
out of START_OBJECT token when Request body is complex
Comment From: wilkinsona
Thanks for the proposal, but the use of Map<String, String>
is intentional. As described in the documentation, it allows the same endpoint to be exposed via multiple technologies (web and JMX are supported at the moment) without the endpoint author having to write any web- or JMX-specific code.
Comment From: taneg
@wilkinsona Hello! I have a question I'd like to ask you. Spring Cloud Config Server Application, Refresh configuration through webhook,There are some problems here.The body looks like this. And then there was this error
{
"secret": "",
"ref": "refs/heads/master",
"before": "7222a9fac4339a129eda1f0d9442840dba649312",
"after": "7222a9fac4339a129eda1f0d9442840dba649312",
"compare_url": "",
"commits": [
{
"id": "7222a9fac4339a129eda1f0d9442840dba649312",
"message": "refresh mq\n",
"url": "http://192.168.0.101:9300/tanxs/test_config/commit/7222a9fac4339a129eda1f0d9442840dba649312",
"author": {
"name": "kal",
"email": "838958665@qq.com",
"username": ""
},
"committer": {
"name": "kal",
"email": "838958665@qq.com",
"username": ""
},
"verification": null,
"timestamp": "0001-01-01T00:00:00Z",
"added": null,
"removed": null,
"modified": null
}
],
"head_commit": null,
"repository": {
"id": 3,
"owner": {"id":2,"login":"tanxs","full_name":"","email":"951641263@qq.com","avatar_url":"http://192.168.0.101:9300/user/avatar/tanxs/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2021-06-25T01:39:33Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tanxs"},
"name": "test_config",
"full_name": "tanxs/test_config",
"description": "",
"empty": false,
"private": true,
"fork": false,
"template": false,
"parent": null,
"mirror": false,
"size": 31,
"html_url": "http://192.168.0.101:9300/tanxs/test_config",
"ssh_url": "ssh://git@192.168.0.101:9322/tanxs/test_config.git",
"clone_url": "http://192.168.0.101:9300/tanxs/test_config.git",
"original_url": "",
"website": "",
"stars_count": 0,
"forks_count": 0,
"watchers_count": 1,
"open_issues_count": 0,
"open_pr_counter": 0,
"release_counter": 0,
"default_branch": "master",
"archived": false,
"created_at": "2021-06-25T02:41:21Z",
"updated_at": "2021-06-25T05:31:55Z",
"permissions": {
"admin": false,
"push": false,
"pull": false
},
"has_issues": true,
"internal_tracker": {
"enable_time_tracker": true,
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true
},
"has_wiki": true,
"has_pull_requests": true,
"has_projects": true,
"ignore_whitespace_conflicts": false,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_squash_merge": true,
"default_merge_style": "merge",
"avatar_url": "",
"internal": false,
"mirror_interval": ""
},
"pusher": {"id":2,"login":"tanxs","full_name":"","email":"951641263@qq.com","avatar_url":"http://192.168.0.101:9300/user/avatar/tanxs/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2021-06-25T01:39:33Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tanxs"},
"sender": {"id":2,"login":"tanxs","full_name":"","email":"951641263@qq.com","avatar_url":"http://192.168.0.101:9300/user/avatar/tanxs/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2021-06-25T01:39:33Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"tanxs"}
}
Comment From: wilkinsona
It sounds like you have configured the webhook with the wrong URL. The webhook should be configured to call the monitor
endpoint. It isn't implemented as an actuator endpoint and already accepts Map<String, Object>
.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.