Last active
April 23, 2019 00:31
-
-
Save mike-neck/5f1c48226931a7d8eb859d45fcc33302 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.Canonical | |
import org.springframework.http.converter.json.* | |
import com.fasterxml.jackson.databind.* | |
@Canonical | |
class Bar { | |
String fooBar | |
} | |
@RestController | |
@RequestMapping('/foo') | |
class Foo { | |
@PutMapping(consumes = 'application/json', produces = 'application/json') | |
def put(@RequestBody Bar bar) { | |
println(bar) | |
bar | |
} | |
} | |
@Configuration | |
class Config { | |
@Bean | |
ObjectMapper objectMapper() { | |
def mapper = new ObjectMapper() | |
mapper.propertyNamingStrategy = PropertyNamingStrategy.SNAKE_CASE | |
mapper | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
sdk i springboot 2.1.4.RELEASE | |
spring run app.groovy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment