Files
REST_SERVER/VERAG_REST_SERVER/App_Start/WiseWebhookExampleProcessor.vb
2025-12-10 10:14:10 +01:00

32 lines
1.3 KiB
VB.net

Imports NSwag.Generation.Processors
Imports NSwag.Generation.Processors.Contexts
Imports NJsonSchema
Public Class WiseWebhookExampleProcessor
Implements IOperationProcessor
Public Function Process(context As OperationProcessorContext) As Boolean Implements IOperationProcessor.Process
If context.ControllerType.Name = "WiseController" AndAlso context.MethodInfo.Name = "Webhook" Then
Dim operation = context.OperationDescription.Operation
If operation.RequestBody IsNot Nothing AndAlso operation.RequestBody.Content.ContainsKey("application/json") Then
Dim content = operation.RequestBody.Content("application/json")
content.Example = New With {
.event_type = "balance.credit",
.data = New With {
.id = 123456789,
.balance_id = 99887766,
.amount = New With {
.value = 1500.00,
.currency = "EUR"
},
.occurred_at = "2025-12-06T10:15:30Z",
.description = "Incoming transfer",
.sender_name = "ACME GmbH"
}
}
End If
End If
Return True
End Function
End Class