question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make default type of Resource as binary

See original GitHub issue

It seems the Spring Resource type is currently not recognized as a binary response (I am returning a Resource subtype - FieSystemResource). The Resource object shows up as a schema in the UI. Here is my current method definition:

@GetMapping("/{imageId}", produces = [MediaType.IMAGE_JPEG_VALUE]) fun getImage(@PathVariable(value = "imageId") imageId: String): Mono<Resource>

Is it possible to somehow override this behavior, to recognize it as a binary response?

Thank you for your help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bnasslahsencommented, Apr 18, 2020

ok @gotson,

We can make the default behaviour of Resource to return binary, which might be useuful for many cases. If someone wants another Return type, he can anyway use @ApiResponse. It will be added to the next release v1.3.3.

0reactions
gotsoncommented, Apr 18, 2020

The same thing the OP requested, it should be considered a binary return type by default.

You mentionned:

We can also plan to add native support for it for the next release.

So i provided the samples as you requested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create resource files - .NET - Microsoft Learn
Create a text file that contains string resources. You can use Resource File Generator (resgen.exe) to convert the text file into a binary...
Read more >
C++ Custom Binary Resource File - Stack Overflow
I am writing my own custom game engine for fun using SDL in C++. I'm trying to create a custom binary file which...
Read more >
Documents | Binary | Care Connect - NHS Connect - Open APIs
A binary resource can contain any content, whether text, image, pdf, zip archive, etc.
Read more >
Resources (Binary and Logical) in Windows Presentation ...
A resource is a noncode piece of an application or compnent like bitmaps, fonts, audio / video files, string tables. WPF supports 2...
Read more >
Enabling binary support using the API Gateway console
Enable binary support in the API Gateway console. ... Set binary media types for the API: ... Create a new or choose an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found