forked from loafle/openapi-generator-original
[kotlin][spring] Fix ApiUtil compilation (#6084)
This commit is contained in:
parent
dc9a898e11
commit
388218bdf9
@ -12,9 +12,9 @@ object ApiUtil {
|
|||||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||||
try {
|
try {
|
||||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||||
res.setCharacterEncoding("UTF-8")
|
res?.characterEncoding = "UTF-8"
|
||||||
res.addHeader("Content-Type", contentType)
|
res?.addHeader("Content-Type", contentType)
|
||||||
res.getWriter().print(example)
|
res?.writer?.print(example)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
throw RuntimeException(e)
|
throw RuntimeException(e)
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ object ApiUtil {
|
|||||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||||
try {
|
try {
|
||||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||||
res.setCharacterEncoding("UTF-8")
|
res?.characterEncoding = "UTF-8"
|
||||||
res.addHeader("Content-Type", contentType)
|
res?.addHeader("Content-Type", contentType)
|
||||||
res.getWriter().print(example)
|
res?.writer?.print(example)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
throw RuntimeException(e)
|
throw RuntimeException(e)
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ object ApiUtil {
|
|||||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||||
try {
|
try {
|
||||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||||
res.setCharacterEncoding("UTF-8")
|
res?.characterEncoding = "UTF-8"
|
||||||
res.addHeader("Content-Type", contentType)
|
res?.addHeader("Content-Type", contentType)
|
||||||
res.getWriter().print(example)
|
res?.writer?.print(example)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
throw RuntimeException(e)
|
throw RuntimeException(e)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user