You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When i generate oneOf message schema for springwolf-ui i get exception - "Error parsing AsyncAPI message of channel queue: Schema com.example.request.Request1 not found".
Dependencies and versions used
springwolf-sqs version 1.9.0
springwolf-ui version 1.9.0
kotlin version 2.0.21
spring version 3.3.5 and dependency manager version 1.1.5
Code Examples
Spring SqsListener
I use only AsyncListener. Sqs listener i disable in application.yml. This example for my sqs listener.
@Component
class QueueListener(
private val service: Service
) {
@SqsListener(
value = ["\${amazon.sqs.queue}"],
)
@AsyncListener(
operation = AsyncOperation(
headers = AsyncOperation.Headers(
schemaName = "Request id header",
values = [AsyncOperation.Headers.Header(
name = "request-id",
description = "Generate from sqs sender"
)]
),
channelName = "queue",
description = "some description",
message = AsyncMessage(
messageId = "com.example.request.BaseRequest"
)
)
)
@SqsAsyncOperationBinding(queues = [SqsAsyncQueueBinding(name = "\${amazon.sqs.queue}")])
fun onMessage(request: LabelDetectRequest) {
when (request) {
is ReqestExample1-> service.mapRequest1(request)
is ReqestExample2 -> service.mapRequest2(request)
}
}
}
Dto class examples
enum class RequestEnum{
REQUEST_1, REQUEST_2
}
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "type"
)
@JsonSubTypes(
JsonSubTypes.Type(
value = Request1::class,
name = "REQUEST_1"
),
JsonSubTypes.Type(
value = Request2::class,
name = "REQUEST_2"
)
)
@Schema(
description = "Base class for request",
discriminatorProperty = "type",
oneOf = [Request1::class, Request2::class]
)
sealed class Request(
@field:Schema(description = "Enum for detected label type", example = "REQUEST_1")
open val type: RequestEnum = RequestEnum.REQUEST_1
)
@Schema(
description = "Class for request 1"
)
data class Request1(
@Schema(description = "Job id from rekognition", example = "00000000-0000-0000-0000-000000000000")
val jobId: String,
@Schema(description = "UUID of project", example = "00000000-0000-0000-0000-000000000000")
val objectId: String,
@Schema(hidden = true)
override val type: RequestEnum= RequestEnum.REQUEST_1
) : Request(type)
data class Request2(
@Schema(description = "UUID of project", example = "00000000-0000-0000-0000-000000000000")
val objectId: String,
@Schema(description = "List labels from rekognition")
val moderationLabels: List<RequestLabel>,
@Schema(hidden = true)
override val type: RequestEnum= RequestEnum.REQUEST_2
) : Request(type)
@Schema(description = "Class for label description from rekognition")
data class RequestLabel(
@JsonProperty("Name")
@Schema(description = "Label name", example = "Human")
val name: String?,
@JsonProperty("Confidence")
@Schema(description = "Percentage of the chance that the label is in the project", example = "99.99")
val confidence: Float?
)
When i send request GET /springwolf/docs i get response -
Hi @FanatTokyoGhoul, thanks a lot for the detailed report. Any chance that you could provide the full specification so that we can reproduce the error with the specification only? You can also provide a MR that reproduces the error if thats easier for you.
Describe the bug
When i generate oneOf message schema for springwolf-ui i get exception - "Error parsing AsyncAPI message of channel queue: Schema com.example.request.Request1 not found".
Dependencies and versions used
springwolf-sqs
version1.9.0
springwolf-ui
version1.9.0
kotlin
version2.0.21
spring
version3.3.5
anddependency manager
version1.1.5
Code Examples
Spring SqsListener
I use only AsyncListener. Sqs listener i disable in application.yml. This example for my sqs listener.
Dto class examples
When i send request GET /springwolf/docs i get response -
When i use springwolf-ui i see this exception
I debugging js code your springwolf-ui and found this code
springwolf-core/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
Lines 290 to 306 in 123fe16
In this code method mapSchemaObj use parameter schemas how {} and in this method has this code
springwolf-core/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
Lines 443 to 445 in 123fe16
In method addPropertiesToSchema this property use for get schemas for payload message
springwolf-core/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
Lines 497 to 509 in 123fe16
This method throw exception.
springwolf-core/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
Lines 511 to 527 in 123fe16
Сode try get schema from {} object which was delivered
springwolf-core/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts
Line 305 in 123fe16
Maybe I'm doing something wrong, but it looks like a bug.
The text was updated successfully, but these errors were encountered: