spiderly.json Configuration

Configure source generator behavior and API settings with spiderly.json.

Overview

spiderly.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.

Setup

1. Create the file in your .Business project (the same directory as your entity classes):

YourApp.Business/spiderly.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.json" />
</ItemGroup>

JSON parsing is case-insensitive — "generators" and "Generators" both work.

Full Example

spiderly.json
{
  "generators": {
    "ServicesGenerator": true,
    "ControllerGenerator": true,
    "EntitiesToDTOGenerator": true,
    "MapperGenerator": true,
    "FluentValidationGenerator": true,
    "AuthorizationServicesGenerator": true,
    "PermissionCodesGenerator": true,
    "PaginatedResultGenerator": true,
    "ExcelPropertiesGenerator": true,
    "TranslationsGenerator": 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).

.NET Generators

GeneratorOutputPurpose
ServicesGeneratorBusinessService.generated.csCRUD 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
TranslationsGeneratorTermsGenerated.generated.csC# translation dictionary from JSON files

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.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.json
{
  "api": {
    "routePrefix": "/v1"
  }
}