スキル一覧に戻る
Mcafee123

swagger

by Mcafee123

0🍴 0📅 2026年1月10日
GitHubで見るManusで実行

SKILL.md


name: swagger description: Configure Swagger/OpenAPI documentation for affolterNET.Web.Bff. Use when setting up API documentation or customizing Swagger UI.

Swagger/OpenAPI Configuration

Configure Swagger/OpenAPI documentation for your BFF.

For complete reference, see Library Guide.

Quick Start

appsettings.json

{
  "affolterNET": {
    "Web": {
      "Swagger": {
        "Enabled": true,
        "Title": "My BFF API",
        "Version": "v1",
        "Description": "Backend-for-Frontend API documentation"
      }
    }
  }
}

Configuration Options

PropertyTypeDefaultDescription
Enabledbooltrue (dev)Enable Swagger UI
Titlestring"API"API title
Versionstring"v1"API version
DescriptionstringnullAPI description
RoutePrefixstring"swagger"URL prefix

BFF-Specific Endpoints

The BFF exposes these endpoints in Swagger:

EndpointDescription
/bff/account/loginInitiates login
/bff/account/logoutLogs out user
/bff/account/userCurrent user info
/api/*Proxied API routes

Controller Documentation

/// <summary>
/// User profile operations
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class ProfileController : ControllerBase
{
    /// <summary>
    /// Gets the current user's profile
    /// </summary>
    /// <returns>User profile data</returns>
    /// <response code="200">Profile retrieved</response>
    /// <response code="401">Not authenticated</response>
    [HttpGet]
    [Authorize]
    [ProducesResponseType(typeof(UserProfile), 200)]
    [ProducesResponseType(401)]
    public IActionResult GetProfile() { ... }
}

Development vs Production

{
  "affolterNET": {
    "Web": {
      "Swagger": {
        "Enabled": true  // Set false in production
      }
    }
  }
}

Or use environment-specific configuration:

// appsettings.Development.json
{
  "affolterNET": {
    "Web": {
      "Swagger": {
        "Enabled": true
      }
    }
  }
}

// appsettings.Production.json
{
  "affolterNET": {
    "Web": {
      "Swagger": {
        "Enabled": false
      }
    }
  }
}

Troubleshooting

Swagger UI shows 401

  • Swagger is served before authentication
  • Check if path is correctly excluded from auth

YARP routes not visible

  • YARP routes are not documented in Swagger
  • Document backend API separately

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です