© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
2 replies
hellounlimited

validate json schema sent from request body to an api

hi all, im trying to send a request from postman to asp net api, but the net api need to validate the schema value pass from the postman request body, how can we validate the value "theValidSchemaValueToAnAPI"? i understand if we want to validate a model state, we put a "Required" data annotation, but validating the value doesnt seem to work..
    public class NoteItem
    {
        private IList<string> _schemas = new List<string> { "theValidSchemaValueToAnAPI" };
        [Required]
        public IList<string> schemas { get { return _schemas; } set { _schemas = value; } }
        public string noteId{ get; set; }
        public string userId { get; set; }
    }
    public class NoteItem
    {
        private IList<string> _schemas = new List<string> { "theValidSchemaValueToAnAPI" };
        [Required]
        public IList<string> schemas { get { return _schemas; } set { _schemas = value; } }
        public string noteId{ get; set; }
        public string userId { get; set; }
    }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,793Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Body request
C#CC# / help
2y ago
NullReference from API JSON
C#CC# / help
3y ago
❔ how to get city data from request body?
C#CC# / help
3y ago