-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,10 @@ class CodeGeneratorDraft04(CodeGenerator): | |
'uri': r'^\w+:(\/?\/?)[^\s]+\Z', | ||
} | ||
|
||
def __init__(self, definition, resolver=None, formats={}, use_default=True): | ||
def __init__(self, definition, resolver=None, formats={}, use_default=True, use_formats=True): | ||
super().__init__(definition, resolver) | ||
self._custom_formats = formats | ||
self._use_formats = use_formats | ||
self._use_default = use_default | ||
self._json_keywords_to_function.update(( | ||
('type', self.generate_type), | ||
|
@@ -254,6 +255,8 @@ def generate_format(self): | |
Valid value for this definition is [email protected] but not @username | ||
""" | ||
if not self._use_formats: | ||
return | ||
with self.l('if isinstance({variable}, str):'): | ||
format_ = self._definition['format'] | ||
# Checking custom formats - user is allowed to override default formats. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = '2.18.1' | ||
VERSION = '2.19.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters