Announcing Krush 1.0

You may know Nussknacker, which is our open-source tool for scenario authoring, but we have a bunch of other projects we want to share with the community. One of these is Krush, which is our attempt to solve data access in Kotlin using the Exposed framework underneath. It is now 3 years in development and is mostly feature-complete, so we decided that this could be a good time to release the 1.0 version. 🎉🎉🎉

yeah, nussknacker is cool, but have you heard of krush?

This release is mostly infrastructure-centric, we introduced support for Kotlin 1.7 and switched our build scripts to Kotlin Gradle. You can read more details in the Changelog.

In case you want to give it a try, a good resource could be project’s README, an introductory post from our blog and some example
repositories if you’d prefer to just dig into code.

Let us know about your thoughts on GitHub or ping us on Twitter!

You May Also Like

Complex flows with Apache Camel

At work, we're mainly integrating services and systems, and since we're on a constant lookout for new, better technologies, ways to do things easier, make them more sustainable, we're trying to Usually we use Apache Camel for this task, which is a Swis...At work, we're mainly integrating services and systems, and since we're on a constant lookout for new, better technologies, ways to do things easier, make them more sustainable, we're trying to Usually we use Apache Camel for this task, which is a Swis...

Grails render as JSON catch

One of a reasons your controller doesn't render a proper response in JSON format might be wrong package name that you use. It is easy to overlook. Import are on top of a file, you look at your code and everything seems to be fine. Except response is still not in JSON format.

Consider this simple controller:

class RestJsonCatchController {
def grailsJson() {
render([first: 'foo', second: 5] as grails.converters.JSON)
}

def netSfJson() {
render([first: 'foo', second: 5] as net.sf.json.JSON)
}
}

And now, with finger crossed... We have a winner!

$ curl localhost:8080/example/restJsonCatch/grailsJson
{"first":"foo","second":5}
$ curl localhost:8080/example/restJsonCatch/netSfJson
{first=foo, second=5}

As you can see only grails.converters.JSON converts your response to JSON format. There is no such converter for net.sf.json.JSON, so Grails has no converter to apply and it renders Map normally.

Conclusion: always carefully look at your imports if you're working with JSON in Grails!

Edit: Burt suggested that this is a bug. I've submitted JIRA issue here: GRAILS-9622 render as class that is not a codec should throw exception