ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
139 stars 86 forks source link

metadata_public returns null and data type verification fails #218

Closed quizmoon closed 1 year ago

quizmoon commented 1 year ago

Preflight checklist

Describe the bug

Our users have no "metadata_public", so when we do "to_session" call we receive back "metadata_public":null Python Client fails as it is expecting Dict in return.

Looks as "metadata_public" and "metadata_admin" have to be declared as "traits" in the: https://github.com/ory/client-python/blob/master/ory_client/model/identity.py

Current version: 'traits': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 'metadata_admin': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 'metadata_public': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501

Should be: 'traits': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 'metadata_admin': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 'metadata_public': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501

Possible it have to be done on level of schema to apply automatically to all the future client recreation.

Reproducing the bug

Create basic user with email / pass only and using ory-client==0.2.0a60 make request "to_session"

Relevant log output

ory_client.exceptions.ApiTypeError: Invalid type for variable 'metadata_public'. Required value type is dict and passed type was NoneType at ['received_data']['identity']['metadata_public']

Relevant configuration

No response

Version

0.2.0a60

On which operating system are you observing this issue?

No response

In which environment are you deploying?

No response

Additional Context

No response

aeneasr commented 1 year ago

Thank you for the report, we'll take a look to see how to solve this!

aeneasr commented 1 year ago

https://github.com/ory/kratos/pull/2841 should resolve this