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
When using the BaseHttpController helper method BaseHttpController.json(...) the resulting express call coerces the json object to a string.
This causes problems when using express middleware that validates JSON responses (in this case using openapi-validator-middleware) as the data is no-longer a JSON object.
Current Behavior
Json content is sent as a string, which causes downstream middleware that expects Json content to fail.
Trying to use the openapi-validator-middleware library with the inversify express server and BaseHttpController.json().
The validator library expects content as JSON data, but the BaseHttpController.json function results in data being sent as a plain string. This causes the validator to skip checks on the result - rendering it useless.
The text was updated successfully, but these errors were encountered:
Reposting issue from invserify-express-utils here.
inversify/inversify-express-utils#378
Expected Behavior
When using the BaseHttpController helper method BaseHttpController.json(...) the resulting express call coerces the json object to a string.
This causes problems when using express middleware that validates JSON responses (in this case using openapi-validator-middleware) as the data is no-longer a JSON object.
Current Behavior
Json content is sent as a string, which causes downstream middleware that expects Json content to fail.
Possible Solution
inversify/inversify-express-utils#379
Context
Trying to use the openapi-validator-middleware library with the inversify express server and
BaseHttpController.json()
.The validator library expects content as JSON data, but the
BaseHttpController.json
function results in data being sent as a plain string. This causes the validator to skip checks on the result - rendering it useless.The text was updated successfully, but these errors were encountered: