Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Merge pull request #3 from tyarkoni/master
Browse files Browse the repository at this point in the history
replace variable parentheses in flask routes
  • Loading branch information
atlithorn committed Mar 9, 2015
2 parents 6e48449 + 8310ee3 commit b79402f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flask_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
import inspect
import yaml
import re


def _sanitize(comment):
Expand Down Expand Up @@ -111,5 +112,8 @@ def spec():
parameters=params
)
if len(operations):
paths[str(rule)] = operations
rule = str(rule)
for arg in re.findall('(<(.*?\:)?(.*?)>)', rule):
rule = rule.replace(arg[0], '{%s}' % arg[2])
paths[rule] = operations
return output

0 comments on commit b79402f

Please sign in to comment.