ServiceNow / PySNC

Python API for ServiceNow
MIT License
91 stars 28 forks source link

serialize_all broken in 1.1.9 #121

Closed miikkajo closed 1 month ago

miikkajo commented 1 month ago

Hi,

I just noticed that in record.py serialize_all() is broken due positional mapping of parameters

1093: return [record.serialize(display_value, fields, fmt, exclude_reference_link) for record in self]

exclude_reference_link maps to 4th param changes_only and not to correct param exclude_reference_link 1053 def serialize(self, display_value=False, fields=None, fmt=None, changes_only=False, exclude_reference_link=True) -> Any:

suggest to use keyword mapping only: return [record.serialize(display_value=display_value, fields=fields, fmt=fmt , exclude_reference_link=exclude_reference_link) for record in self]

andrewduckett commented 1 month ago

Hey @vetsin, totally missed the extra argument in serialize. I opened a PR to do as @miikkajo describes above (use kw arguments) that should make this more obvious.

vetsin commented 1 month ago

No one talks about the down side of unit tests -- when you become over-confident in them. Released 1.1.10