のパラメータに表示するオブジェクトからパラメータを抽出するために、私は、次のAPIエンドポイントを持っている。このようkey
などどのようにドキュメント
@ApiResponses(
value = {
@ApiResponse(code = 200, message = "OK",
responseHeaders = {
@ResponseHeader(name = "X-RateLimit-Limit", description = "The defined maximum number of requests available to the consumer for this API.", response = Integer.class),
@ResponseHeader(name = "X-RateLimit-Remaining", description = "The number of calls remaining before the limit is enforced and requests are bounced.", response = Integer.class),
@ResponseHeader(name = "X-RateLimit-Reset", description = "The time, in seconds, until the limit expires and another request will be allowed in. This header will only be present if the limit is being enforced.", response = Integer.class)
}
)
}
)
@ApiOperation(httpMethod = "GET", hidden = false, nickname = "Get Network Availability in JSON", value = "Get network availability for a product", response = AvailableToPromise.class, position = 1)
@RequestMapping(value = "/{product_id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> networkAvailabilityJsonResponse(
@RequestHeader HttpHeaders headers,
@PathVariable("product_id") String productId,
@Valid NetworkAvailabilityCmd cmd, //query params
BindingResult result)
throws Exception {}
}
一部のパラメータは、クエリから取られ、春のMVCでこのオブジェクトにマッピングされます。このパラメータリストにNetworkAvailabilityCmd
ショーである変数の
なし:ただし、闊歩-UIの私のエンドポイントのパラメータセクションでは、それは私にいくつかの奇妙なものを見せて
cmd自体は要求本体に置かれているように表示されます(実際にはクエリに配置されています)。 cmd
を隠してこのオブジェクトの中のparamsを抽出してparamsリストに表示する方法はありますか?私は(もっとのparamsで)このように見えるのparamsリストが欲しい:
私はメソッドのエンドポイントで@ApiImplicitParams
を使用している場合、これを行う、とのparamsのそれぞれを書き出すことができますよ。しかし、このNetworkAvailabilityCmd
は多くのエンドポイントで使用されており、各エンドポイント上のパラメーターリストは非常に乱雑です。オブジェクト内から変数を抽出することが可能であることははるかにクリーンであり、人々が新しいエンドポイントにリスト全体を追加することを忘れることを防ぐことになります。
NetworkAvailabilityCmd cmd
の注釈が必要で、そのクラスの変数に潜在的に何かがあると思いますが、ドキュメントで探しているものが見つからないようです。
ありがとうございます!