2017-07-04 16 views
0

私は現在、私が闊歩を使って、APIドキュメントを生成していると私が闊歩応答で同じセットアップを探しています?WebApiConfig.csSwaggerでAPI応答パラメータをスネークケースに変換するにはどうすればよいですか?

public static class WebApiConfig 
{ 
    public static void Register(HttpConfiguration config) 
    { 
     config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver 
     { 
      NamingStrategy = new SnakeCaseNamingStrategy() 
     }; 
    } 
} 

に線の下に追加してヘビのケースに私のAPIの応答パラメータを変更しましたかこのためにSwaggerにオプションがありますか?

現在のドキュメント出力:

enter image description here

予想されるドキュメントの出力:

enter image description here

+0

このリンクを試す:https://stackoverflow.com/questions/28552567/web-api-2-how-to-return-json-with-camelcased-property-names-on-objects-and-the – Sujith

答えて

関連する問題