Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 5b779b5

Browse files
linusgmrstegeman
authored andcommitted
Omit @type if empty (#61)
1 parent 466230a commit 5b779b5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

webthing/thing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def as_thing_description(self):
4545
'id': self.id,
4646
'title': self.title,
4747
'@context': self.context,
48-
'@type': self.type,
4948
'properties': self.get_property_descriptions(),
5049
'actions': {},
5150
'events': {},
@@ -93,6 +92,9 @@ def as_thing_description(self):
9392
if self.description:
9493
thing['description'] = self.description
9594

95+
if self.type:
96+
thing['@type'] = self.type
97+
9698
return thing
9799

98100
def get_href(self):

0 commit comments

Comments
 (0)