Description
When importing licenses via the /api/v1/licenses/import endpoint, the system currently fails if boolean fields ("marydone") are provided as strings in the JSON file. This results in a 500 error with the message:
{
"status": 500,
"message": "invalid json",
"error": "json: cannot unmarshal string into Go struct field LicenseDB.marydone of type bool",
"path": "/api/v1/licenses/import",
"timestamp": "2025-03-24T12:30:15+05:30"
}
Steps to Reproduce
- Use licenseRef.json containing license data with "marydone": "f" (as a string)
- Submit this file to the import endpoint
- Observe the 500 error response
Expected Behavior
The API should handle string representations of boolean values and convert them appropriately using parseBool function.