Skip to content

@RequestBody Mono<Tweet> gives a blank schema #163

@davidmelia

Description

@davidmelia

Hi,

this might be a bug or new feature request but for

	@PostMapping(value = "/tweets/does-not-work", consumes = MediaType.APPLICATION_JSON_VALUE)
	public Mono<Tweet> postNotWorks(@RequestBody Mono<Tweet> tweet) {
		return tweet;
	}

returns a blank schema in swagger

As a work around I can do

	@PostMapping(value = "/tweets/work-around", consumes = MediaType.APPLICATION_JSON_VALUE)
	public Mono<Tweet> postNotWorkAround(
			@RequestBody @io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(schema = @Schema(implementation = Tweet.class))) Mono<Tweet> tweet) {
		return tweet;
	}

but it would be great if the default behaviour was to unpack the POST body Mono or Flux and use the type as the schema just as you are doing on return Monos or Fluxs.

Is this possible?

Thanks

P.S. https://github.com/davidmelia/springdoc-webflux contains an example where "/tweets/does-not-work" shows the blank schema problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions