"""OpenAPI/Swagger documentation endpoints."""
from flask import Blueprint, jsonify
docs_bp = Blueprint('docs', __name__)
@docs_bp.route('/', methods=['GET'])
def swagger_ui():
"""Serve Swagger UI."""
html = '''
ServerKit API Documentation
'''
return html, 200, {'Content-Type': 'text/html'}
@docs_bp.route('/openapi.json', methods=['GET'])
def openapi_spec():
"""Return the generated OpenAPI specification."""
from app.services.openapi_service import OpenAPIService
spec = OpenAPIService.generate_spec()
return jsonify(spec)