You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To parse a text/plain request body, the express app needs to use express.text()).
Need to call the multer middleware within the endpoint body to handle the case in which file is not passed as an input.
Check if file has been passed as an input, if not, check if the request body is empty, if yes then throw an error response stating that the input has not been provided.
parseFileInput has to be renamed to parseInput as it'll take care of both file and string inputs now.
In case of parsing the string input, the syntax of the specification can be derived using JSON.parse(). If the string is successfully parsed, then it is a JSON, otherwise YAML.