eclipse-tractusx / sldt-semantic-hub

Apache License 2.0
7 stars 10 forks source link

POST & PUT API - Incorrect Status Parameter Handling #289

Open mittalVaghela opened 4 weeks ago

mittalVaghela commented 4 weeks ago

Description

In the Semantic Hub application, both the POST and PUT APIs include two query parameters: status and type. The status parameter is a required field, with valid values being DRAFT, RELEASED, STANDARDIZED, and DEPRECATED.

Current Behavior

If the status parameter is passed with a null or blank value in either the POST or PUT API, the API currently returns a 500 Internal Server Error.

Expected Behavior

Steps To Reproduce

For POST API:

For PUT API:

Proposed Solution:

Add validation to check the status parameter before processing the request in both POST and PUT APIs. If null or blank, the APIs should return a 400 Bad Request response with an appropriate error message.