Skip to content

Commit

Permalink
integer schema
Browse files Browse the repository at this point in the history
  • Loading branch information
barbuza committed Dec 2, 2016
1 parent 0959769 commit b677ee9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ def to_json(self):
return {'type': 'number'}


class Integer(Schema):
def to_json(self):
return {'type': 'integer'}


class String(Schema):
def to_json(self):
return {'type': 'string'}
Expand Down
4 changes: 3 additions & 1 deletion test_project/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,16 @@ def test_schema(self):
schema = s.Object(
str=s.String(),
number=s.Optional(s.Number()),
integer=s.Integer(),
null=s.Null(),
boolean=s.Boolean(),
array=s.Array(s.String()),
child=child
)
data = {
'str': '',
'number': 1,
'number': 1.2,
'integer': 2,
'null': None,
'boolean': True,
'array': [''],
Expand Down

0 comments on commit b677ee9

Please sign in to comment.