Building an Endpoint
Each endpoint is meant to be treated as a separate module within the API.Every endpoint file should contain a function which matches an
HTTP method in lower case.
Most common are post, get, put, patch, delete; this library does support custom methods,
if you so choose. As long as the method of the request matches the function name, it will work.
Each method within the endpoint file can have individual validation requirements. These requirements allow you to test all structural points of the request, with the ability to use JSONSchema and custom middleware to further extend the validation options as well as add additional logic to verify data beyond structural and data-type requirements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |