Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Creates FastAPI routers with CRUD endpoints, authentication dependencies, response models, and HTTP status codes.
68% 100%+32 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 15 of 22 without it.
3 of 3 safety checks passed
Not used yet
"""
{{ResourceName}} Router
Handles CRUD operations for {{resource_name}} resources.
Template placeholders to replace:
- {{ResourceName}} (PascalCase)
- {{resource_name}} (snake_case)
- {{resource_plural}} (plural snake_case)
"""
from typing import Optional
from fastapi import APIRouter, Depends, HTTPException, Query, status
from app.auth.jwt import get_current_user, get_current_user_required
from app.models.user import User
from app.models.{{resource_name}} import (
{{ResourceName}},
{{ResourceName}}Create,
{{ResourceName}}Update,
)
from app.services.{{resource_name}}_service import {{ResourceName}}Service
router = APIRouter(prefix="/api", tags=["{{resource_plural}}"])
# ============================================================================
# Dependencies
# ============================================================================
def get_service() -> {{ResourceName}}Service:
"""Dependency to get service instance."""
return {{ResourceName}}Service()
# ============================================================================
# Endpoints
# ============================================================================
Published skills whose descriptions closely match this one, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.