Skip to content

Commit

Permalink
Merge pull request #242 from linkml/issue-linkml-193
Browse files Browse the repository at this point in the history
Export patterns in jsonschemagen, fixes #193
  • Loading branch information
cmungall authored Jun 25, 2021
2 parents ff252b8 + b6fcb66 commit c3a7296
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 c3a7296

Please sign in to comment.