0
我已通過添加下面一行用揚鞭改變了我的API響應參數蛇情況WebApiConfig.cs
如何將API響應參數轉換爲Swagger中的蛇情況?
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver
{
NamingStrategy = new SnakeCaseNamingStrategy()
};
}
}
目前我生成API文檔,我期待在揚鞭響應相同的設置? Swagger中有這個選項嗎?
當前文檔輸出:
預期的文檔輸出:
嘗試此鏈接:https://stackoverflow.com/questions/28552567/web-api-2-how-to-return-json-with-camelcased-property-names-on-objects-and-the – Sujith