Skip to content
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

not support biginteger when length greate than 16 #13579

Closed
damozhiying opened this issue Jun 26, 2018 · 4 comments
Closed

not support biginteger when length greate than 16 #13579

damozhiying opened this issue Jun 26, 2018 · 4 comments
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@damozhiying
Copy link

damozhiying commented Jun 26, 2018

import io.swagger.annotations.ApiOperation;
import java.math.BigInteger;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/apis/gateway-conf")
public class ApiGatewayInfoController {

@ApiOperation(value = "获取api网关信息")
	@RequestMapping(value = "/test2", method = RequestMethod.GET)
	public Zoo getGatewayInfo3() throws DcoosException {

		BigInteger bi = new BigInteger("999999999999999889");
		Zoo z = new Zoo(bi,"abc");

		return z;
	}
	@ApiOperation(value = "获取api网关信息")
	@RequestMapping(value = "/test3", method = RequestMethod.GET)
	public BigInteger getGatewayInfo4() throws DcoosException {

		BigInteger bi = new BigInteger("999999999999999889");

		return bi;
	}
}
response body
{
  "bi": 999999999999999900,
  "name": "abc"
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 26, 2018
@wilkinsona
Copy link
Member

How have you verified the contents of the response? It works for me using curl or HTTPie. If you'd like us to spend more time investigating, please provide a complete example of how to reproduce the problem (something that we can unzip or git clone and run) including how you are calling the service and checking the contents of the response.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jun 26, 2018
@damozhiying
Copy link
Author

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 26, 2018
@wilkinsona
Copy link
Member

Thanks. As suspected, this isn't due to Spring Boot. The response is as expected when accessed with curl:

$ curl localhost:8080/apis/gateway-conf/test2
{"bi":999999999999999889,"name":"abc"}

The problem only occurs when Swagger UI is involved. See swagger-api/swagger-ui#2030.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Jun 26, 2018
@damozhiying
Copy link
Author

@wilkinsona thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants