1
1
package no.nav.klage.document.api
2
2
3
- import io.swagger.annotations.Api
4
- import io.swagger.annotations.ApiOperation
3
+ import io.swagger.v3.oas. annotations.Operation
4
+ import io.swagger.v3.oas. annotations.tags.Tag
5
5
import no.nav.klage.document.api.views.CommentInput
6
6
import no.nav.klage.document.api.views.CommentView
7
7
import no.nav.klage.document.api.views.DocumentView
@@ -23,7 +23,7 @@ import java.util.*
23
23
24
24
@RestController
25
25
@ProtectedWithClaims(issuer = ISSUER_AAD )
26
- @Api(tags = [ " kabal-smart-editor-api" ] )
26
+ @Tag(name = " kabal-smart-editor-api" )
27
27
@RequestMapping(" /documents" )
28
28
class DocumentController (
29
29
private val documentService : DocumentService ,
@@ -37,9 +37,9 @@ class DocumentController(
37
37
private val secureLogger = getSecureLogger()
38
38
}
39
39
40
- @ApiOperation (
41
- value = " Create document" ,
42
- notes = " Create document"
40
+ @Operation (
41
+ summary = " Create document" ,
42
+ description = " Create document"
43
43
)
44
44
@PostMapping(" " )
45
45
fun createDocument (
@@ -50,9 +50,9 @@ class DocumentController(
50
50
return mapToDocumentView(documentService.createDocument(json))
51
51
}
52
52
53
- @ApiOperation (
54
- value = " Update document" ,
55
- notes = " Update document"
53
+ @Operation (
54
+ summary = " Update document" ,
55
+ description = " Update document"
56
56
)
57
57
@PutMapping(" /{documentId}" )
58
58
fun updateDocument (
@@ -64,29 +64,29 @@ class DocumentController(
64
64
return mapToDocumentView(documentService.updateDocument(documentId, json))
65
65
}
66
66
67
- @ApiOperation (
68
- value = " Get document" ,
69
- notes = " Get document"
67
+ @Operation (
68
+ summary = " Get document" ,
69
+ description = " Get document"
70
70
)
71
71
@GetMapping(" /{documentId}" )
72
72
fun getDocument (@PathVariable(" documentId" ) documentId : UUID ): DocumentView {
73
73
log(" getDocument called with id $documentId " )
74
74
return mapToDocumentView(documentService.getDocument(documentId))
75
75
}
76
76
77
- @ApiOperation (
78
- value = " Delete document" ,
79
- notes = " Delete document"
77
+ @Operation (
78
+ summary = " Delete document" ,
79
+ description = " Delete document"
80
80
)
81
81
@DeleteMapping(" /{documentId}" )
82
82
fun deleteDocument (@PathVariable(" documentId" ) documentId : UUID ) {
83
83
log(" deleteDocument called with id $documentId " )
84
84
documentService.deleteDocument(documentId)
85
85
}
86
86
87
- @ApiOperation (
88
- value = " Create comment for a given document" ,
89
- notes = " Create comment for a given document"
87
+ @Operation (
88
+ summary = " Create comment for a given document" ,
89
+ description = " Create comment for a given document"
90
90
)
91
91
@PostMapping(" /{documentId}/comments" )
92
92
fun createComment (
@@ -104,9 +104,9 @@ class DocumentController(
104
104
)
105
105
}
106
106
107
- @ApiOperation (
108
- value = " Get all comments for a given document" ,
109
- notes = " Get all comments for a given document"
107
+ @Operation (
108
+ summary = " Get all comments for a given document" ,
109
+ description = " Get all comments for a given document"
110
110
)
111
111
@GetMapping(" /{documentId}/comments" )
112
112
fun getAllCommentsWithPossibleThreads (
@@ -116,9 +116,9 @@ class DocumentController(
116
116
return commentService.getComments(documentId).map { mapCommentToView(it) }
117
117
}
118
118
119
- @ApiOperation (
120
- value = " Reply to a given comment" ,
121
- notes = " Reply to a given comment"
119
+ @Operation (
120
+ summary = " Reply to a given comment" ,
121
+ description = " Reply to a given comment"
122
122
)
123
123
@PostMapping(" /{documentId}/comments/{commentId}/replies" )
124
124
fun replyToComment (
@@ -138,9 +138,9 @@ class DocumentController(
138
138
)
139
139
}
140
140
141
- @ApiOperation (
142
- value = " Get a given comment" ,
143
- notes = " Get a given comment"
141
+ @Operation (
142
+ summary = " Get a given comment" ,
143
+ description = " Get a given comment"
144
144
)
145
145
@GetMapping(" /{documentId}/comments/{commentId}" )
146
146
fun getCommentWithPossibleThread (
@@ -151,9 +151,9 @@ class DocumentController(
151
151
return mapCommentToView(commentService.getComment(commentId = commentId))
152
152
}
153
153
154
- @ApiOperation (
155
- value = " Generer PDF" ,
156
- notes = " Generer PDF"
154
+ @Operation (
155
+ summary = " Generer PDF" ,
156
+ description = " Generer PDF"
157
157
)
158
158
@ResponseBody
159
159
@GetMapping(" /{documentId}/pdf" )
0 commit comments