FusionAuth / fusionauth-python-client

FusionAuth Python Client
https://fusionauth.io
Apache License 2.0
24 stars 12 forks source link

fix issue with example due to None for userId #6

Closed sycured closed 4 years ago

sycured commented 4 years ago

If None is present, we obtain an error:

{
    "fieldErrors":{
        "registration":[
            {
                "code":"[missing]registration",
                "message":"Your request is missing the Registration information as JSON in the entity-body."
            }
        ],
        "userId":[
            {
                "code":"[couldNotConvert]userId",
                "message":"Invalid userId [{'registration': {'applicationId': '194db1ce-9951-446d-8ec1-ff0bdfda6cfe'}, 'user': {'birthDate': '1976-05-30', 'email': 'john@doe.io', 'password': 'password', 'firstName': 'John', 'lastName': 'Doe', 'twoFactorEnabled': False, 'username': 'johnny123'}, 'sendSetPasswordEmail': False, 'skipVerification': True}]. This must be a valid UUID String (e.g. 25a872da-bb44-4af8-a43d-e7bcb5351ebc)."
            }
        ]
    }
}
robotdan commented 4 years ago

@trex looks like this would need to be fixed in the client builder for it to keep across builds. Will the None always work for an optional parameter?

https://github.com/FusionAuth/fusionauth-client-builder/blob/6daa4876a8200541289e99c49be42f0cd7f6a02f/src/main/client/_macros.ftl#L257

trex commented 4 years ago

@robotdan the issue is that the client parameters were reordered in this commit and the example was not updated to reflect. You can pass None for an optional parameters, so this change could also have been made to: client_response = client.register(user_registration_request, None)

robotdan commented 4 years ago

@trex ah, got it. Ok, thanks, - this is only in the example, not in the client itself. Sorry, didn't look close enough.