-
Hi all, I tried my best to look at the way how to support adding "validate_assignment" to all models I generated, but I could not. How exactly to do it? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
koxudaxi
Jan 18, 2023
Replies: 1 comment 1 reply
-
@RockyMM you can give There is an example. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
koxudaxi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@RockyMM
I'm sorry for my too-late reply.
you can give
"validate_assignment: true"
to CLI as extra template dataThere is an example.
Extra template data
https://github.com/koxudaxi/datamodel-code-generator/pull/861/files#diff-96cd3db7657ae012e5e90c9b016d36593ad1dec7cdccc98cb7b963d3be295f25R4
CLI Option
https://github.com/koxudaxi/datamodel-code-generator/pull/861/files#diff-41d180f6f7233d175c2dfe36c45c4ea80eed4754fa7ed4eed46ccde1b2a778c7R529-R530
Result
https://github.com/koxudaxi/datamodel-code-generator/pull/861/files#diff-98421a2d3c6f4ad61fced284f1ea6f75aca0957c867f773499d27977abc9575dR13-R14