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) {
|
||||
try {
|
||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||
res.setCharacterEncoding("UTF-8")
|
||||
res.addHeader("Content-Type", contentType)
|
||||
res.getWriter().print(example)
|
||||
res?.characterEncoding = "UTF-8"
|
||||
res?.addHeader("Content-Type", contentType)
|
||||
res?.writer?.print(example)
|
||||
} catch (e: IOException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
|
@ -9,9 +9,9 @@ object ApiUtil {
|
||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||
try {
|
||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||
res.setCharacterEncoding("UTF-8")
|
||||
res.addHeader("Content-Type", contentType)
|
||||
res.getWriter().print(example)
|
||||
res?.characterEncoding = "UTF-8"
|
||||
res?.addHeader("Content-Type", contentType)
|
||||
res?.writer?.print(example)
|
||||
} catch (e: IOException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
|
@ -9,9 +9,9 @@ object ApiUtil {
|
||||
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
|
||||
try {
|
||||
val res = req.getNativeResponse(HttpServletResponse::class.java)
|
||||
res.setCharacterEncoding("UTF-8")
|
||||
res.addHeader("Content-Type", contentType)
|
||||
res.getWriter().print(example)
|
||||
res?.characterEncoding = "UTF-8"
|
||||
res?.addHeader("Content-Type", contentType)
|
||||
res?.writer?.print(example)
|
||||
} catch (e: IOException) {
|
||||
throw RuntimeException(e)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user