-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add @Consume(content-type)
to all REST services class or methods
#987
Comments
@ikhoon nim, i want to take this task! |
Sure. Thanks for your interest! |
#999 didn't handle all API. For example, we still need to specify Lines 137 to 141 in a4e5893
|
Lines 53 to 66 in a4e5893
Sorry, i missed it. May i create new PR to fix it? |
@ikhoon nim, It seems that this code you mentioned is not about Lines 137 to 141 in a4e5893
By the way, i took a look at more, i found this code.( Lines 101 to 104 in e78a569
|
Central Dogma only uses JSON in REST APIs for the content-type.
centraldogma/server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java Line 775 in 534f6bf
If a content-type is not specified, JacksonRequestConverterFunction won't convert the body into CreateProjectRequest .
|
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.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-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.If
@ConsumeJson
is added to the method,405 Method Not Allowed
is returned which would make it easier to identify the cause.The text was updated successfully, but these errors were encountered: