File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -503,11 +503,11 @@ def endpoint(self, name):
503
503
@property
504
504
def specs_url (self ):
505
505
"""
506
- The Swagger specifications absolute url (ie. `swagger.json`)
506
+ The Swagger specifications relative url (ie. `swagger.json`)
507
507
508
508
:rtype: str
509
509
"""
510
- return url_for (self .endpoint ("specs" ), _external = True )
510
+ return url_for (self .endpoint ("specs" ))
511
511
512
512
@property
513
513
def base_url (self ):
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def __init__(
156
156
self .description = description
157
157
self .required = required
158
158
self .readonly = readonly
159
- self .example = example or self .__schema_example__
159
+ self .example = example if example is not None else self .__schema_example__
160
160
self .mask = mask
161
161
162
162
def format (self , value ):
Original file line number Diff line number Diff line change @@ -298,6 +298,14 @@ def test_with_default(self):
298
298
assert not field .required
299
299
assert field .__schema__ == {"type" : "boolean" , "default" : True }
300
300
301
+ def test_with_example (self ):
302
+ field = fields .Boolean (default = True , example = False )
303
+ assert field .__schema__ == {
304
+ "type" : "boolean" ,
305
+ "default" : True ,
306
+ "example" : False ,
307
+ }
308
+
301
309
@pytest .mark .parametrize (
302
310
"value,expected" ,
303
311
[
You can’t perform that action at this time.
0 commit comments