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.
|
* <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.
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-typeis not specified in some API methods.centraldogma/server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
Lines 187 to 191 in 24603eb
That results in generating a converter not found error message if
content-typeis missing.For example, a commit is sent without
content-type,No suitable request converteris returned from which users don't know what is wrong.If
@ConsumeJsonis added to the method,405 Method Not Allowedis returned which would make it easier to identify the cause.