Configuration (vrpc.yaml)
The vrpc.yaml file is the source of truth for all your API clients. It uses a registry-based structure to support one or more API specifications.
Structure
yaml
# yaml-language-server: $schema=./node_modules/vrpc/schema.json
specs:
# The key 'api' is the name of your client
api:
# Path or URL to OpenAPI spec
specPath: '../../apps/api/docs/swagger.json'
# Where to output the generated files
outputDir: 'src/vrpc'
# You can add more specs here
billing:
specPath: 'https://billing.example.com/swagger.json'
outputDir: 'src/vrpc/billing'Properties
| Property | Type | Description |
|---|---|---|
specPath | string | Local path or URL to the OpenAPI/Swagger JSON file. |
outputDir | string | The directory where vRPC will generate the schema, procedures, and map. |
IDE Support
vRPC includes a built-in JSON schema. By adding the comment at the top of your vrpc.yaml, you get:
- Autocompletion for properties.
- Validation for required fields.
- Hover documentation.
yaml
# yaml-language-server: $schema=./node_modules/vrpc/schema.json