我有用例我需要根据field的选择得到requestBody。下面是相同的代码,我能够得到动态responseBody基于选择ProtocolType.Is有任何方式swagger可以动态读取RequestBody。 / p>
import country_data
for code in country_data.countrycodes:
print(country_data.codemap[code], ':')
print('\t', 'Head honcho:', country_data.countries[country_data.codemap[code]]['head honcho'])
print('\t', 'Population:', country_data.countries[country_data.codemap[code]]['population'], 'million')
=IF(OR(REGEXMATCH('Sheet'!AJ2;"ok");REGEXMATCH('Sheet'!AE2;"ok"));"1";"2")
@ApiOperation(value = "Protocol Account", tags = {"ProtocolAccount"})
@RequestMapping(value = "/protocolAccount/{protocolName}",
method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody public ProtocolAccount getProtocol(@PathVariable String protocolName)
{
return service.getProtocol(protocolName);
}
public ProtocolAccount getProtocol(String protocolName){
ProtocolAccount protocolAccount=new ProtocolAccount();
Object object=ProtocolType.fromMap(protocolName);
protocolAccount.setProtocol(object);
return protocolAccount;
}