diff options
Diffstat (limited to 'rest-api-templates')
-rw-r--r-- | rest-api-templates/res_ari_resource.c.mustache | 7 | ||||
-rw-r--r-- | rest-api-templates/swagger_model.py | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/rest-api-templates/res_ari_resource.c.mustache b/rest-api-templates/res_ari_resource.c.mustache index e6b2a88f4..8e043e682 100644 --- a/rest-api-templates/res_ari_resource.c.mustache +++ b/rest-api-templates/res_ari_resource.c.mustache @@ -53,6 +53,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #if defined(AST_DEVMODE) #include "ari/ari_model_validators.h" #endif +{{^has_websocket}} +{{! Only include http_websocket if necessary. Otherwise we'll do a lot of + * unnecessary optional_api intialization, which makes optional_api harder + * to debug + }} +#include "asterisk/http_websocket.h" +{{/has_websocket}} #define MAX_VALS 128 diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py index aa065b342..af52266b4 100644 --- a/rest-api-templates/swagger_model.py +++ b/rest-api-templates/swagger_model.py @@ -632,6 +632,8 @@ class ApiDeclaration(Stringify): api_json = api_decl_json.get('apis') or [] self.apis = [ Api().load(j, processor, context) for j in api_json] + self.has_websocket = filter(lambda api: api.has_websocket, + self.apis) == [] models = api_decl_json.get('models').items() or [] self.models = [Model().load(id, json, processor, context) for (id, json) in models] |