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
{{ message }}
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.
hi,
in my resources definition I have a POST endpoint to create an entity.
I didn't saw any documentation about body params, but i tried swagger.bodyParam and it worked.
I wonder, how can I define some properties as required and return 404 if they are not sent?
here is my endpoint definition:
createNew: {'spec': {"description": "Operations about swimmer","path": "/swimmer","notes": "","summary": "Create a new swimmer","method": "POST","parameters": [swagger.bodyParam("swimmer","","Swimmer")],"type": "Swimmer","errorResponses": [swagger.errors.invalid('id'),swagger.errors.notFound('swimmer')],"nickname": "createSwimmer",produces: ["application/json"]},'action': function(req,res,next){// do something - don't arrive here is some properties are not sentres.sendStatus(200);}}
The text was updated successfully, but these errors were encountered:
Hi, you can make a parameter required, and the UI will not allow you to submit without it being passed. The server, however, is up to you to throw the 404 (or more appropriately 400) if it's not passed outside of swagger ui.
hi,
in my resources definition I have a POST endpoint to create an entity.
I didn't saw any documentation about body params, but i tried
swagger.bodyParam
and it worked.I wonder, how can I define some properties as required and return 404 if they are not sent?
here is my endpoint definition:
The text was updated successfully, but these errors were encountered: