Skip to content

Commit 2e72c89

Browse files
committed
docs: add documentation for generator configuration
1 parent 724ff6f commit 2e72c89

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/basics/options.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generator Options
2+
The generator behavior can be configured using the `dogs` section in your `pubspec.yaml` file.
3+
4+
``` { .yaml .file title="pubspec.yaml" .focus hl_lines="5-100" }
5+
dev_dependencies:
6+
build_runner: any
7+
dogs_generator: any
8+
9+
dogs:
10+
library: false
11+
property_case: keep
12+
name_case: keep
13+
enum_case: keep
14+
```
15+
16+
## Options
17+
#### `library` (default: `false`)
18+
If set to `true`, the generator will generate library named modules instead to prevent conflicts when sharing
19+
models across multiple packages.
20+
#### `property_case` (default: `keep`)
21+
Defines the casing style for generated property names.
22+
#### `name_case` (default: `keep`)
23+
Defines the casing style for generated class and enum serial names.
24+
#### `enum_case` (default: `keep`)
25+
Defines the casing style for generated enum values.
26+
27+
## Casing Options
28+
- `keep`: Keep the original name.
29+
- `camel`: Convert to camelCase.
30+
- `pascal`: Convert to PascalCase.
31+
- `snake`: Convert to snake_case.
32+
- `kebab`: Convert to kebab-case.
33+
- `constant`: Convert to CONSTANT_CASE.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ nav:
3535
- basics/polymorphism.md
3636
- basics/projection.md
3737
- basics/validation.md
38+
- basics/options.md
3839
- "Advanced Concepts":
3940
- advanced/structures.md
4041
- advanced/annotations.md

0 commit comments

Comments
 (0)