Spiderly Configuration
Configure source generator behavior and API settings with .spiderly/config.json.
Overview
.spiderly/config.json is an optional configuration file that controls how Spiderly's source generators behave. Use it to:
- Disable specific generators — useful when you only need a subset of generated code (e.g., backend-only projects that don't need Angular generators)
- Customize the API route prefix — change the default
/apiprefix on generated controller routes
If you don't create this file, all generators are enabled and the default /api route prefix is used.
Formerly a root-level spiderly.json. When upgrading an existing app, move it to
.spiderly/config.json and update the AdditionalFiles path (see Setup below).
Setup
1. Create the file at .spiderly/config.json in your .Business project (the same project as your entity classes):
{
"generators": {},
"api": {
"routePrefix": "/api"
}
}2. Register it in your .Business .csproj as an additional file so the source generators can read it:
<ItemGroup>
<AdditionalFiles Include=".spiderly/config.json" />
</ItemGroup>"generators" and "Generators" both work.Full Example
{
"generators": {
"ServicesGenerator": true,
"ControllerGenerator": true,
"EntitiesToDTOGenerator": true,
"MapperGenerator": true,
"FluentValidationGenerator": true,
"AuthorizationServicesGenerator": true,
"PermissionCodesGenerator": true,
"PaginatedResultGenerator": true,
"ExcelPropertiesGenerator": true,
"NgEntitiesGenerator": false,
"NgControllersGenerator": false,
"NgBaseDetailsGenerator": false,
"NgValidatorsGenerator": false,
"NgEnumsGenerator": false
},
"api": {
"routePrefix": "/api"
}
}generators
A dictionary of generator name → true/false. Any generator not listed defaults to true (enabled).
This switch controls generated artifacts only. Entity-shape validation — the build diagnostics that tell you an entity is malformed — runs in a separate generator that produces no output and cannot be disabled, so it is not in the tables below. Declining code you don't want should never also decline the checks that say your entities are well-formed.
.NET Generators
| Generator | Output | Purpose |
|---|---|---|
ServicesGenerator | {Entity}Service.generated.cs | Per-entity CRUD operations, data retrieval, Excel export |
ControllerGenerator | BaseControllers.generated.cs | REST API endpoints for each entity |
EntitiesToDTOGenerator | DTOList.generated.cs | DTO classes mirroring your entities |
MapperGenerator | Mapper.generated.cs | Mapster config for entity ↔ DTO mapping |
FluentValidationGenerator | ValidationRules.generated.cs | FluentValidation rules from attributes |
AuthorizationServicesGenerator | AuthorizationService.generated.cs | Permission checks for CRUD operations |
PermissionCodesGenerator | PermissionCodes.generated.cs | Static permission code constants |
PaginatedResultGenerator | PaginatedResultGenerator.generated.cs | Dynamic EF Core filtering queries |
ExcelPropertiesGenerator | ExcelPropertiesToExclude.generated.cs | Properties to exclude from Excel export |
Angular Generators
| Generator | Output | Purpose |
|---|---|---|
NgEntitiesGenerator | entities.generated.ts | TypeScript classes mirroring C# DTOs |
NgControllersGenerator | api.service.generated.ts | Typed HTTP methods for all API endpoints |
NgBaseDetailsGenerator | base-details.generated.ts | Form components for entity detail pages |
NgValidatorsGenerator | validators.generated.ts | Angular form validators from C# attributes |
NgEnumsGenerator | enums.generated.ts | TypeScript enums from C# enums |
Example: Backend-only project
If your project doesn't use the Spiderly Angular frontend (e.g., you're pairing the backend with a different frontend like Next.js), disable all Angular generators:
{
"generators": {
"NgEntitiesGenerator": false,
"NgControllersGenerator": false,
"NgBaseDetailsGenerator": false,
"NgValidatorsGenerator": false,
"NgEnumsGenerator": false
}
}api
Configuration for the generated API controllers.
routePrefix
| Property | Type | Default |
|---|---|---|
routePrefix | string | "/api" |
Sets the route prefix on generated controller [Route] attributes. By default, generated controllers use:
[Route("/api/Product/[action]")]Setting routePrefix to "/v1" produces:
[Route("/v1/Product/[action]")]{
"api": {
"routePrefix": "/v1"
}
}