Skip to content

how to deal with byte array mapping ? #191

Closed Answered by hauner
beeondev asked this question in Q&A
Discussion options

You must be logged in to vote

looks like Mono<ResponseEntity<byte[]>> isn't something the processor can generate at the moment. The mapping parser doesn't handle primitive types.

a workaround is to exclude the endpoint

map:
  paths:
    /my-endpoint:
      exclude: true

and write the controller method yourself.

or

you could try to replace the byte[] with something like java.nio.ByteBuffer (as an endpoint specific mapping). But I don't know if Spring can serialize this out of the box.

map:
  paths:
    /my-endpoint:
      types:
       - type: string:binary => java.nio.ByteBuffer

to generate the Mono and ResponseEntity you need:

map:
  result: org.springframework.http.ResponseEntity

  single: reactor.core.publisher.…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by beeondev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants