helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.5k stars 566 forks source link

Add a way to provide supported content types to JsonSupport #100

Open romain-grecourt opened 6 years ago

romain-grecourt commented 6 years ago

Support any content type for JSON support

The content-types supported by the current JSON support utility are hard-coded. We need to provide a way for users to specify the content type that are associated with JSON payload.

Steps to reproduce

Register JSON support, send JSON payload with a post request with content-type application/x-www-form-urlencoded

romain-grecourt commented 5 years ago

Actually this needs to be a general mechanism for any supported media type. @tomas-langer what do you think ?

tomas-langer commented 5 years ago

Not sure this should be a general mechanism (as we are using a Service to implement the JSON support). Maybe we could have an abstract media type support that has a builder that can be configured, though the logic is not simple (as we must take into account the Accept and Content-Type headers).

romain-grecourt commented 5 years ago

A base service class for media type support services would do.

spericas commented 5 years ago

After the discussion earlier in the week, can we close this stating that we need to support application/x-www-form-urlencoded instead?