cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP code of DefaultService result

Highlighted
Occasional Visitor

HTTP code of DefaultService result

I point in swagger.yaml that the /chat/ path may return both 200(posted) and 403(banned) HTTP codes. How can I return 403 code from js generated by Swagger?

/**
 * Chat with others
 *
 * roomId String 
 * message String 
 * key String 
 **/
exports.chat = function(roomId,message,key) {
  return new Promice(resolve, reject) {
    if (IsValid(key)) {
      resolve({}); // server answers 200/OK with JSON
    } else {
      ??? // need answer 403/Forbidden
    }
  }
}

 

0 REPLIES 0
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors