perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Use a default response transformer #998

Closed richarddd closed 6 years ago

richarddd commented 6 years ago

I would find it useful to add a default response transformer. I'm using spark as a REST API thus all my responses should be json.

setDefaultResponseTransformer(new JsonTransformer());

I also removed some unused imports from Service.java (and applied formatting)

richarddd commented 6 years ago

@tipsy @flyrev could you please look at this? 👍 :)

tipsy commented 6 years ago

Nice, looks good to me. As a general rule you should try to keep "general cleanup" out of feature commits, so that the PR is easier to review. This is a pretty significant API change, so @perwendel will have to approve it.

richarddd commented 6 years ago

@tipsy I've updated the PR to remove formatting. Turns out my IntelliJ config applied auto-formatting on save which used star imports and destroyed the default formatting.

@perwendel Please check this PR when you have a few minutes over. Would significantly remove a lot of boilerplate in my project :)

richarddd commented 6 years ago

@tipsy and @perwendel Understand that you are super busy but this should not be a major change :) Please check as soon as you have time!

tipsy commented 6 years ago

Looks good to me, but Per wants to merge API changes himself.

perwendel commented 6 years ago

@richarddd @tipsy reviewing!

perwendel commented 6 years ago

Thanks @richarddd !