Skip to content

Commit

Permalink
Add validation check for PartOfSpeechId
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Jan 10, 2025
1 parent 93bc1b5 commit 4890857
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/FwLite/MiniLcm/Validators/SenseValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public SenseValidator()
RuleFor(s => s.Definition).NoEmptyValues();
RuleFor(s => s.Gloss).NoEmptyValues();
RuleFor(s => s.PartOfSpeech!).SetValidator(new PartOfSpeechValidator()).When(s => s.PartOfSpeech is not null);
RuleFor(s => s.PartOfSpeechId).Equal(s => s.PartOfSpeech!.Id).When(s => s.PartOfSpeech is not null && s.PartOfSpeechId is not null);
RuleForEach(s => s.SemanticDomains).SetValidator(new SemanticDomainValidator());
RuleForEach(s => s.ExampleSentences).SetValidator(sense => new ExampleSentenceValidator(sense));
}
Expand Down

0 comments on commit 4890857

Please sign in to comment.