Merge branch '44-reporting-service-returns-http-500-when-invalid-json-is-used' into...
authorMichael Winsauer <e1429715@student.tuwien.ac.at>
Thu, 13 Dec 2018 12:37:26 +0000 (13:37 +0100)
committerMichael Winsauer <e1429715@student.tuwien.ac.at>
Thu, 13 Dec 2018 12:37:26 +0000 (13:37 +0100)
Resolve "Reporting service returns http 500 when invalid json is used"

Closes #44

See merge request aic18/G6T4!37

service-reporting/Models/Term.cs

index bb6289036aa49bfa77c966bd8bc63d8120de2461..a2c4c8d5b907b3968023b71162eb8452a180f750 100644 (file)
@@ -1,4 +1,4 @@
-
+using System.ComponentModel.DataAnnotations;
 namespace PdfService.Models
 {
     // represents the data got from sentiment analysis.
@@ -9,7 +9,10 @@ namespace PdfService.Models
             this.Name = Name;
             this.Sentiment = Sentiment;
         }
+        [Required]
         public string Name { get; set; }
+        [Range(0.0,1.0)]
+        [Required]
         public double Sentiment { get; set; }
     }
 }
\ No newline at end of file