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 /api prefix 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):

YourApp.Business/.spiderly/config.json
{
  "generators": {},
  "api": {
    "routePrefix": "/api"
  }
}

2. Register it in your .Business .csproj as an additional file so the source generators can read it:

YourApp.Business/YourApp.Business.csproj
<ItemGroup>
  <AdditionalFiles Include=".spiderly/config.json" />
</ItemGroup>
JSON parsing is case-insensitive — "generators" and "Generators" both work.

Full Example

.spiderly/config.json
{
  "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

GeneratorOutputPurpose
ServicesGenerator{Entity}Service.generated.csPer-entity CRUD operations, data retrieval, Excel export
ControllerGeneratorBaseControllers.generated.csREST API endpoints for each entity
EntitiesToDTOGeneratorDTOList.generated.csDTO classes mirroring your entities
MapperGeneratorMapper.generated.csMapster config for entity ↔ DTO mapping
FluentValidationGeneratorValidationRules.generated.csFluentValidation rules from attributes
AuthorizationServicesGeneratorAuthorizationService.generated.csPermission checks for CRUD operations
PermissionCodesGeneratorPermissionCodes.generated.csStatic permission code constants
PaginatedResultGeneratorPaginatedResultGenerator.generated.csDynamic EF Core filtering queries
ExcelPropertiesGeneratorExcelPropertiesToExclude.generated.csProperties to exclude from Excel export

Angular Generators

GeneratorOutputPurpose
NgEntitiesGeneratorentities.generated.tsTypeScript classes mirroring C# DTOs
NgControllersGeneratorapi.service.generated.tsTyped HTTP methods for all API endpoints
NgBaseDetailsGeneratorbase-details.generated.tsForm components for entity detail pages
NgValidatorsGeneratorvalidators.generated.tsAngular form validators from C# attributes
NgEnumsGeneratorenums.generated.tsTypeScript 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:

.spiderly/config.json
{
  "generators": {
    "NgEntitiesGenerator": false,
    "NgControllersGenerator": false,
    "NgBaseDetailsGenerator": false,
    "NgValidatorsGenerator": false,
    "NgEnumsGenerator": false
  }
}

api

Configuration for the generated API controllers.

routePrefix

PropertyTypeDefault
routePrefixstring"/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]")]
.spiderly/config.json
{
  "api": {
    "routePrefix": "/v1"
  }
}