Skip to content

Commit

Permalink
Prepare release 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Dec 15, 2017
1 parent 174f115 commit bdf7e8a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#########
Changelog
#########


*********
**1.0.3**
*********

- **FIX:** fixed bug that caused schema views returned from cache to fail (:issue:`14`)
- **FIX:** disabled automatic generation of response schemas for form operations to avoid confusing errors caused by
attempting to shove file parameters into Schema objects

*********
**1.0.2**
*********

- First published version
41 changes: 41 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import sys

import sphinx_rtd_theme
from docutils import nodes, utils
from docutils.parsers.rst import roles
from docutils.parsers.rst.roles import set_classes
from pkg_resources import get_distribution

# -- General configuration ------------------------------------------------
Expand Down Expand Up @@ -204,3 +207,41 @@

# instantiate a SchemaView in the views module to make it available to autodoc
drf_yasg.views.SchemaView = drf_yasg.views.get_schema_view(None)

ghiss_uri = "https://github.com/axnsan12/drf-yasg/issues/%d"
ghpr_uri = "https://github.com/axnsan12/drf-yasg/pull/%d"


def role_github_pull_request_or_issue(name, rawtext, text, lineno, inliner, options=None, content=None):
options = options or {}
content = content or []
try:
ghid = int(text)
if ghid <= 0:
raise ValueError
except ValueError:
msg = inliner.reporter.error(
'GitHub pull request or issue number must be a number greater than or equal to 1; '
'"%s" is invalid.' % text, line=lineno
)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
# Base URL mainly used by inliner.rfc_reference, so this is correct:

if name == 'pr':
ref = ghpr_uri
elif name == 'issue':
ref = ghiss_uri
else:
msg = inliner.reporter.error('unknown tag name for GitHub reference - "%s"' % name, line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]

ref = ref % ghid
set_classes(options)
node = nodes.reference(rawtext, '#' + utils.unescape(text), refuri=ref, **options)
return [node], []


roles.register_local_role('pr', role_github_pull_request_or_issue)
roles.register_local_role('issue', role_github_pull_request_or_issue)
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ drf-yasg
settings.rst
contributing.rst
license.rst
changelog.rst

Source code documentation
=========================
Expand Down
1 change: 0 additions & 1 deletion src/drf_yasg/openapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import copy
from collections import OrderedDict

from coreapi.compat import urlparse
Expand Down

0 comments on commit bdf7e8a

Please sign in to comment.