Skip to content

Commit 8ca9693

Browse files
committed
update readme for the struct-tag-cases usage
1 parent 1d0c656 commit 8ca9693

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,28 @@ down_singular = "teamName"
644644
foreign = "Videos"
645645
```
646646

647+
648+
##### Custom Struct Tag Case
649+
650+
Sometimes you might want to customize the case style for different purpose, for example, use camel case for json format and use snake case for yaml,
651+
You may create a section named `[struct-tag-cases]` to define these custom case for each different format:
652+
653+
```toml
654+
[struct-tag-cases]
655+
toml = "snake"
656+
yaml = "camel"
657+
json = "camel"
658+
boil = "alias"
659+
```
660+
661+
By default, the snake case will be used, so you can just setup only few formats:
662+
663+
```toml
664+
[struct-tag-cases]
665+
json = "camel"
666+
```
667+
668+
647669
##### Foreign Keys
648670

649671
You can add foreign keys not defined in the database to your models using the following configuration:

0 commit comments

Comments
 (0)