Currently, the required fields in the patron API do not match the required fields in the CSV imports.. and they don't entirely make sense.. city and address are required for example.. is there some reasoning behind those choices?
First spec for this is that I feel we should make sure the required fields match those listed in the csv import page.
Created attachment 144218 [details] [review] Bug 31160: Required Fields in Patron API The Patron API PUT request required the fields "surname","address","city","library_id","category_id". Meanwhile the CSV import page for patrons only requires "surname","library_id","category_id". The fields for "address" and "city" have been removed from the "required" section of the api>v1>swagger>definitions>patron.yaml file to match the CSV import page. Test Plan: 1) Send a PUT request to http://localhost:8081/api/v1/patrons/19 with an empty body 2) Error message should ask for 5 missing fields as listed above 3) Apply patch 4) Restart Apache server using "restart_all" in your ktd shell 5) Resubmit your request 6) Error message should now only request "surname","library_id","category_id"
Remember to set 'Needs Signoff' Matt ;)
Created attachment 144308 [details] [review] Bug 31160: Required Fields in Patron API The Patron API PUT request required the fields "surname","address","city","library_id","category_id". Meanwhile the CSV import page for patrons only requires "surname","library_id","category_id". The fields for "address" and "city" have been removed from the "required" section of the api>v1>swagger>definitions>patron.yaml file to match the CSV import page. Test Plan: 1) Send a PUT request to http://localhost:8081/api/v1/patrons/19 with an empty body 2) Error message should ask for 5 missing fields as listed above 3) Apply patch 4) Restart Apache server using "restart_all" in your ktd shell 5) Resubmit your request 6) Error message should now only request "surname","library_id","category_id" Signed-off-by: David Nind <david@davidnind.com>
Hi Matt. I'll let you fix up the title for the patch - it should be in sentence case. David Testing notes using KTD (koha-testing-docker): 1. I used Postman to make the request. 2. I had to put empty curly brackets in the body ({}) and select JSON as the format to get the error message asking for the empty fields.
Created attachment 144313 [details] [review] Bug 31160: Required fields in patron api The Patron API PUT request required the fields "surname","address","city","library_id","category_id". Meanwhile the CSV import page for patrons only requires "surname","library_id","category_id". The fields for "address" and "city" have been removed from the "required" section of the api>v1>swagger>definitions>patron.yaml file to match the CSV import page. Test Plan: 1) Send a PUT request to http://localhost:8081/api/v1/patrons/19 with an empty body 2) Error message should ask for 5 missing fields as listed above 3) Apply patch 4) Restart Apache server using "restart_all" in your ktd shell 5) Resubmit your request 6) Error message should now only request "surname","library_id","category_id" Signed-off-by: David Nind <david@davidnind.com>
Created attachment 144525 [details] [review] Bug 31160: Required fields in patron api The Patron API PUT request required the fields "surname","address","city","library_id","category_id". Meanwhile the CSV import page for patrons only requires "surname","library_id","category_id". The fields for "address" and "city" have been removed from the "required" section of the api>v1>swagger>definitions>patron.yaml file to match the CSV import page. Test Plan: 1) Send a PUT request to http://localhost:8081/api/v1/patrons/19 with an empty body 2) Error message should ask for 5 missing fields as listed above 3) Apply patch 4) Restart Apache server using "restart_all" in your ktd shell 5) Resubmit your request 6) Error message should now only request "surname","library_id","category_id" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to 22.11.x for the next release