mailchimp-client-lib-codegen icon indicating copy to clipboard operation
mailchimp-client-lib-codegen copied to clipboard

Update api.mustache to enforce that required params cannot be empty strings

Open nrschultz opened this issue 1 year ago • 1 comments

Description

This PR updates the required field checks to ensure that a required field value cannot be an empty string.

This may not be the right solution, it may be better to limit this value check to fields that are required in the path, since when provided in a query argument an empty string could be a completely valid value.

Known Issues

When calling an endpoint like GET /lists/<list_id>, if the list_id provided is an empty string, the python api client ends up calling GET /lists/ instead, which results in fetching a different set of data than intended.

This should be able to be reproduced by running something like

response = client.lists.get_list('')

instead of getting a client error or a 404, you'll get back the full set of lists, as if the call made was client.lists.get_lists(). This is unexpected, since the call is clearly made to get a single list, and any assumptions that are made about the shape of the data returned in the response will be incorrect.

nrschultz avatar Jan 23 '24 15:01 nrschultz

Contributor License Agreement Instructions Thanks for your pull request. Before we can review your work, you’ll need to sign a Contributor License Agreement (CLA).

Please download the appropriate CLA below. Once downloaded, please read, sign, and send back to us at [email protected]. Please note, this account is not monitored so please visit https://mailchimp.com/contact/ if you need support.

Individual CLA: Mailchimp Individual CLA Corporate CLA: Mailchimp Corporate CLA

Once you’ve emailed us the signed CLA, please reply here (e.g. CLA signed and sent!) and we’ll verify it.

What to do if you already signed the CLA Individual signers • If you’ve previously sent us a signed CLA, please reply here letting us know and we’ll verify. If we are unable to verify, It’s possible we don’t have your GitHub username or you’re using a different email address on your Git commit. Check that the CLA you previously submitted was sent to us using the email address associated with your GitHub username and verify that your email is set on your Git commits. Corporate signers • Your company has a Point of Contact (POC) who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you’ve previously sent us an updated CLA, please reply here letting us know and we’ll verify. • The email used to register you as an authorized contributor must be the email used for the Git commit. • The email used to register you as an authorized contributor must also be attached to your GitHub account.

cla-bot[bot] avatar Jan 23 '24 15:01 cla-bot[bot]