-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Labels
Description
All Central Dogma APIs use JSON (Patch) to exchange data. A Central Dogma server can't handle other types such as XML or YAML.
Currently, the request content-type
is not specified in some API methods.
Lines 187 to 191 in 24603eb
* <p>Pushes a commit. | |
*/ | |
@Post("/projects/{projectName}/repos/{repoName}/contents") | |
@RequiresWritePermission | |
public CompletableFuture<PushResultDto> push( |
That results in generating a converter not found error message if
content-type
is missing.For example, a commit is sent without
content-type
, No suitable request converter
is returned from which users don't know what is wrong.
$ curl -XPOST "http://127.0.0.1:36462/api/v1/projects/foo/repos/bar/contents" \
-H "Authorization: Bearer appToken-***" \
-d '{
"commitMessage" : {
"summary": "hello",
"detail": "a",
"markup": "MARKDOWN"
},
"changes" : [
{
"path" : "/foo0.json",
"type" : "UPSERT_JSON",
"content" : {"a": "bar2"}
}
]
}'
{"exception":"java.lang.IllegalArgumentException","message":"No suitable request converter found for a @RequestObject 'CommitMessageDto'"}%
If @ConsumeJson
is added to the method, 405 Method Not Allowed
is returned which would make it easier to identify the cause.
injae-kim