Skip to content

Commit

Permalink
fix: Serialize line numbers even if zero
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 12, 2024
1 parent e7d50cc commit 55e6e0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/griffe/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,9 @@ def as_dict(self, *, full: bool = False, **kwargs: Any) -> dict[str, Any]:
},
)

if self.lineno:
if self.lineno is not None:
base["lineno"] = self.lineno
if self.endlineno:
if self.endlineno is not None:
base["endlineno"] = self.endlineno
if self.docstring:
base["docstring"] = self.docstring
Expand Down

0 comments on commit 55e6e0e

Please sign in to comment.