Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydantic model causes error for system.members endpoint #26

Open
aescolastico opened this issue Apr 10, 2024 · 0 comments
Open

pydantic model causes error for system.members endpoint #26

aescolastico opened this issue Apr 10, 2024 · 0 comments

Comments

@aescolastico
Copy link

other endpoints work fine.

im simply trying to use the get method without any pagination or paramaters.

errant line:
members = api.system.members.get()

python trace:
System.Private.CoreLib: Exception while executing function: Functions.timesheet_audit. System.Private.CoreLib: Result: Failure Exception: ValidationError: 1 validation error for Member lastName Field required [type=missing, input_value={'id': 149, 'identifier':...MemberTemplateRecId': 0}, input_type=dict] For further information visit https://errors.pydantic.dev/2.0.2/v/missing Stack: File "C:\ProgramData\chocolatey\lib\azure-functions-core-tools\tools\workers\python\3.10\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 495, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "c:\python310\lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\ProgramData\chocolatey\lib\azure-functions-core-tools\tools\workers\python\3.10\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 768, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "C:\ProgramData\chocolatey\lib\azure-functions-core-tools\tools\workers\python\3.10\WINDOWS\X64\azure_functions_worker\extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "project_dir\timesheet_audit\__init__.py", line 8, in main processed = timesheet_audit.process() File "project_dir\timesheet_audit\timesheet_audit.py", line 16, in process members = api.system.members.get() File "venv_dir\.venv\lib\site-packages\pyconnectwise\endpoints\manage\SystemMembersEndpoint.py", line 73, in get return self._parse_many(Member, super()._make_request("GET", data=data, params=params).json()) File "venv_dir\.venv\lib\site-packages\pyconnectwise\endpoints\base\connectwise_endpoint.py", line 166, in _parse_many return [model_type.model_validate(d) for d in data] File "venv_dir\.venv\lib\site-packages\pyconnectwise\endpoints\base\connectwise_endpoint.py", line 166, in <listcomp> return [model_type.model_validate(d) for d in data] File "venv_dir\.venv\lib\site-packages\pydantic\main.py", line 480, in model_validate return cls.__pydantic_validator__.validate_python( .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant