Skip to content

Can't get parameter with content #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yissacharcw opened this issue Apr 23, 2020 · 1 comment
Closed

Can't get parameter with content #600

yissacharcw opened this issue Apr 23, 2020 · 1 comment

Comments

@yissacharcw
Copy link

I have an API that takes a JSON string as a query param and am trying to map it to OpenAPI but can't seem to do it.

@GetMapping(value = "/foo")
public void foobar(@Parameter(description = "User", name = "user", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))) @RequestParam("bar") String bar) {
 		ObjectMapper objectMapper = new ObjectMapper();
		try {
			User user = objectMapper.readValue(bar, User.class);
		} catch (IOException e) {
			e.printStackTrace();
		}

}

This gets generated as:

"/admin/foo":{"get":{"tags":["my-controller"],"operationId":"foobar","parameters":[{"name":"user","in":"query","description":"User","required":true,"schema":{}}]

Quite possibly I am doing something wrong but it is not clear what I should be doing instead.

@bnasslahsen
Copy link
Collaborator

Hi @yissacharcw,

Will be fixed in the next release with #601.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants