這裏主要在DocInclusionPredicate控制輸出那些api。json
若不想使用Microsoft.AspNetCore.Mvc下的ApiExplorerSettingsAttribute,能夠本身建一個ApiGroupAttribute。api
請將上面代碼中的ApiExplorerSettingsAttribute替換爲ApiGroupAttribute,ApiExplorerSettings替換爲ApiGroup。blog
ApiGroupAttribute代碼以下文檔
若不使用[ApiExplorerSettings(GroupName= "GroupName")] api將在V1顯示。io
swagger經過輸出json如:「swagger/{documentName}/swagger.json「 顯示Api文檔,咱們能夠本身編寫解析json以實現本身的api文檔UI。swagger