Description
If resource is not passed in sharedResource request body (POST API /service/gds/resource):
{ "name": "SHR4", "dataShareId": 5, "resource": { } }
Following error is received:
{ "statusCode": 1, "msgDesc": "Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.12.v20230209-e5c4074ef3): org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception: java.sql.SQLIntegrityConstraintViolationException: (conn=106) Column 'resource' cannot be null\nError Code: 1048\nCall: INSERT INTO x_gds_shared_resource (access_types, ADDED_BY_ID, additional_info, condition_expr, CREATE_TIME, data_share_id, description, guid, is_enabled, name, options, profiles, resource, resource_signature, row_filter, sub_resource, sub_resource_masks, sub_resource_type, UPDATE_TIME, UPD_BY_ID, version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n\tbind => [21 parameters bound]\nQuery: ValueReadQuery(name=\"X_GDS_SHARED_RESOURCE_SEQ\" sql=\"SELECT LAST_INSERT_ID()\")" }
Ideally in response, HTTP Status code 400 (Bad request) should be thrown with custom error message.