Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/pydantic2linkml/gen_linkml.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ def attach_note(note: str) -> None:
slots.sort(key=str.casefold)
slot_usage.sort(key=lambda s: s.name.casefold())

# Ensure notes are sorted in a consistent order
notes.sort()

return ClassDefinition(
model.__name__,
description=(
Expand Down Expand Up @@ -448,6 +451,10 @@ def generate(self) -> SlotDefinition:
# Shape the contained slot according to core schema of the corresponding field
self._shape_slot(self._field_schema.schema)

# Ensure the notes in the slot definition are sorted in a consistent order
assert isinstance(self._slot.notes, list)
self._slot.notes.sort()

self._used = True
return self._slot

Expand Down
Loading