@@ -115,9 +115,9 @@ public Response getFlowByName(@PathParam(ApiConstants.QNAME) @NotNull String flo
115
115
@ Operation (summary = "Create a new agama flow" , description = "Create a new agama flow" , operationId = "post-agama-flow" , tags = {
116
116
"Configuration – Agama Flow" }, security = @ SecurityRequirement (name = "oauth2" , scopes = {
117
117
ApiAccessConstants .AGAMA_WRITE_ACCESS }))
118
- @ RequestBody (description = "Agama Flow" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Request example" , value = "example/agama/agama.json" )))
118
+ @ RequestBody (description = "Agama Flow" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Request example" , value = "example/agama/agama.json" )))
119
119
@ ApiResponses (value = {
120
- @ ApiResponse (responseCode = "201" , description = "Created" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ) , examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
120
+ @ ApiResponse (responseCode = "201" , description = "Created" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
121
121
@ ApiResponse (responseCode = "401" , description = "Unauthorized" ),
122
122
@ ApiResponse (responseCode = "500" , description = "InternalServerError" ) })
123
123
@ POST
@@ -146,9 +146,9 @@ public Response createFlow(@Valid Flow flow)
146
146
@ Operation (summary = "Create a new agama flow from source" , description = "Create a new agama flow from source." , operationId = "post-agama-flow-from-source" , tags = {
147
147
"Configuration – Agama Flow" }, security = @ SecurityRequirement (name = "oauth2" , scopes = {
148
148
ApiAccessConstants .AGAMA_WRITE_ACCESS }))
149
- @ RequestBody (description = "Agama Flow" , content = @ Content (mediaType = MediaType .TEXT_PLAIN , schema = @ Schema (implementation = String .class ) , examples = @ ExampleObject (name = "Request example" , value = "example/agama/test-agama-source.json" )))
149
+ @ RequestBody (description = "Agama Flow" , content = @ Content (mediaType = MediaType .TEXT_PLAIN , schema = @ Schema (implementation = String .class ), examples = @ ExampleObject (name = "Request example" , value = "example/agama/test-agama-source.json" )))
150
150
@ ApiResponses (value = {
151
- @ ApiResponse (responseCode = "201" , description = "Created" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ) , examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
151
+ @ ApiResponse (responseCode = "201" , description = "Created" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
152
152
@ ApiResponse (responseCode = "400" , description = "Bad Request" ),
153
153
@ ApiResponse (responseCode = "401" , description = "Unauthorized" ),
154
154
@ ApiResponse (responseCode = "500" , description = "InternalServerError" ) })
@@ -187,9 +187,9 @@ public Response createFlowFromSource(@PathParam(ApiConstants.QNAME) @NotNull Str
187
187
@ Operation (summary = "Update agama flow from source file" , description = "Update agama flow from source file." , operationId = "put-agama-flow-from-source" , tags = {
188
188
"Configuration – Agama Flow" }, security = @ SecurityRequirement (name = "oauth2" , scopes = {
189
189
ApiAccessConstants .AGAMA_WRITE_ACCESS }))
190
- @ RequestBody (description = "String representing patch-document." , content = @ Content (mediaType = MediaType .TEXT_PLAIN , schema = @ Schema (implementation = String .class ), examples = @ ExampleObject (name = "Request example" , value = "example/agama/test-agama-source.json" )))
190
+ @ RequestBody (description = "String representing patch-document." , content = @ Content (mediaType = MediaType .TEXT_PLAIN , schema = @ Schema (implementation = String .class ), examples = @ ExampleObject (name = "Request example" , value = "example/agama/test-agama-source.json" )))
191
191
@ ApiResponses (value = {
192
- @ ApiResponse (responseCode = "200" , description = "Ok" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
192
+ @ ApiResponse (responseCode = "200" , description = "Ok" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
193
193
@ ApiResponse (responseCode = "401" , description = "Unauthorized" ),
194
194
@ ApiResponse (responseCode = "404" , description = "Not Found" ),
195
195
@ ApiResponse (responseCode = "500" , description = "InternalServerError" ) })
@@ -223,9 +223,9 @@ public Response updateFlowSource(@PathParam(ApiConstants.QNAME) @NotNull String
223
223
@ Operation (summary = "Partially modify a Agama Flow" , description = "Partially modify a Agama Flow" , operationId = "patch-agama-flow" , tags = {
224
224
"Configuration – Agama Flow" }, security = @ SecurityRequirement (name = "oauth2" , scopes = {
225
225
ApiAccessConstants .AGAMA_WRITE_ACCESS }))
226
- @ RequestBody (description = "JsonPatch object" , content = @ Content (mediaType = MediaType .APPLICATION_JSON_PATCH_JSON , array = @ ArraySchema (schema = @ Schema (implementation = JsonPatch .class )) , examples = @ ExampleObject (name = "Request example" , value = "example/agama/agama-patch.json" )))
226
+ @ RequestBody (description = "JsonPatch object" , content = @ Content (mediaType = MediaType .APPLICATION_JSON_PATCH_JSON , array = @ ArraySchema (schema = @ Schema (implementation = JsonPatch .class )), examples = @ ExampleObject (name = "Request example" , value = "example/agama/agama-patch.json" )))
227
227
@ ApiResponses (value = {
228
- @ ApiResponse (responseCode = "200" , description = "Patched Agama Flow" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
228
+ @ ApiResponse (responseCode = "200" , description = "Patched Agama Flow" , content = @ Content (mediaType = MediaType .APPLICATION_JSON , schema = @ Schema (implementation = Flow .class ), examples = @ ExampleObject (name = "Response example" , value = "example/agama/agama.json" ))),
229
229
@ ApiResponse (responseCode = "401" , description = "Unauthorized" ),
230
230
@ ApiResponse (responseCode = "404" , description = "Not Found" ),
231
231
@ ApiResponse (responseCode = "500" , description = "InternalServerError" ) })
@@ -397,12 +397,15 @@ private Flow updateMetadata(Flow flow) {
397
397
}
398
398
399
399
private Flow minimize (Flow flow , boolean includeSource ) {
400
-
400
+ if (flow == null ) {
401
+ return flow ;
402
+ }
401
403
flow .setTranspiled (null );
402
404
flow .setTransHash (null );
403
405
if (!includeSource ) {
404
406
flow .setSource (null );
405
407
}
408
+
406
409
return flow ;
407
410
408
411
}
0 commit comments