Skip to content

Commit

Permalink
Add pattern gen for jsonschema, fixes #193
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed Jun 21, 2021
1 parent ff252b8 commit b6fcb66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linkml/generators/jsonschemagen.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def visit_class_slot(self, cls: ClassDefinition, aliased_slot_name: str, slot: S
prop.description = slot.description
if slot.required:
self.clsobj.required.append(underscore(aliased_slot_name))

if slot.pattern:
# See https://github.com/linkml/linkml/issues/193
prop.pattern = slot.pattern
self.clsobj.properties[underscore(aliased_slot_name)] = prop
if self.topCls is not None and camelcase(self.topCls) == camelcase(cls.name) or \
self.topCls is None and cls.tree_root:
Expand Down

0 comments on commit b6fcb66

Please sign in to comment.