diff options
author | Kevin Harwell <kharwell@digium.com> | 2016-08-18 17:16:43 -0500 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2016-08-18 17:16:43 -0500 |
commit | ff2378c73598b4df55ef1508c93bd97c480a4945 (patch) | |
tree | 226116ecd9580d02fcb96bb7465558ff021a2568 /rest-api-templates | |
parent | cab6975b02b55b8b91560b5a186c6f82a4d7ee55 (diff) |
rest-api: Swagger scripts were not replacing format variable in file brief
Given resource paths did not have 'json' substituted in for the '{format}'. For
some auto generated documentation/comment strings it resulted in something like
the following:
"... REST handler for /api-docs/sounds.{format}"
This patch makes sure the resource api's path is properly substituted.
ASTERISK-25472 #close
Change-Id: Ie3e950a35db4043e284019d6c9061f3b03922e23
Diffstat (limited to 'rest-api-templates')
-rw-r--r-- | rest-api-templates/swagger_model.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py index f3b49e12e..e0eda0143 100644 --- a/rest-api-templates/swagger_model.py +++ b/rest-api-templates/swagger_model.py @@ -688,7 +688,7 @@ class ResourceApi(Stringify): def load(self, api_json, processor, context): context = context.next_stack(api_json, 'path') validate_required_fields(api_json, self.required_fields, context) - self.path = api_json['path'] + self.path = api_json['path'].replace('{format}', 'json') self.description = api_json['description'] if not self.path or self.path[0] != '/': @@ -697,7 +697,7 @@ class ResourceApi(Stringify): return self def load_api_declaration(self, base_dir, processor): - self.file = (base_dir + self.path).replace('{format}', 'json') + self.file = (base_dir + self.path) self.api_declaration = ApiDeclaration().load_file(self.file, processor) processor.process_resource_api(self, [self.file]) |