I have below API endpoint which has input member ID and member details. I am testing it from postman but despite passing wrong property name, API is working fine. I am not getting how its working fine.
public async Task<ActionResult<IEnumerable<Emp>>> GetStudentMarks(long rollNo, [FromBody] Subject subs)
{
//do stuff
}
My Subject class is
public class Subject
{
/// <summary>
/// Array of subject names
/// </summary>
[Required]
public string[] SubjectNames { get; set; }
/// <summary>
/// Include Last Semester Marks or not
/// </summary>
[Required]
public bool? IncludeLastSemesterMarks { get; set; }
}
When I am testing it locally in postman with below URL, its working fine.
https://localhost:7120/v1/API/getstudentmarks/1234
{
"SubjectNames": ["English", "History"],
"**LastSemesterMarks**": true
}
My property name in request is wrong and stil its working fine. Any idea please, why it is so