Closed LegendarySpork9 closed 1 week ago
Added authorisation endpoint. Need to complete validation.
All endpoints added and tested on the UAT environment.
Code rearranged and retested. Submitting to HF for review and suggestions
Full details attached. API Feedback.docx
Make a validation service to check the models instead of checking in the controller.
Need something like the following for validation.
internal class ModelValidationService
{
public bool IsValid(object model, bool? allRequired = false)
{
PropertyInfo[] properties = GetProperties(model);
foreach (PropertyInfo property in properties)
{
Console.WriteLine("{0} is of type {1}", property.Name, property.PropertyType);
var value = property.GetValue(model, null);
if (value != null)
{
Console.WriteLine("{0} is valid with value {1}", property.Name, value);
}
}
return true;
}
private PropertyInfo[] GetProperties(object model)
{
return model.GetType().GetProperties();
}
}
Have the validation service return the response if the model is invalid.
Left to do before this can be closed.
Having trouble deploying to the server. Awaiting some help from Kyle to get the application to recognise the URL and use it.
Add Endpoint for adding new users.
All work complete and tested.
Build the Assistant API and Test it.