Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6
I tried the following approaches before settling on a fix:
nextCursor
to the api spec. This wasn't the greatest solution though because you end up needing to figure out how to customize thesrc/Apis/MP/US/OrdersApi.php::getAllOrdersRequest
function to add special case handling for thenextCursor
parameter and not send the other default parameters. It seems like avoiding special cases like this is better if you can when working on generated code like this.nextCursor
querystringv3/orders/{nextCursor}
. This was no good because you can't include special characters (?, &, etc) in a path parameter according to the openapi specs I was looking through.I settled on a solution where I add the additional missing query string parameters contained within the
nextCursor
response to the existing/v3/orders
endpoint.This is a little annoying for the end user of this library because you need to break up the querystring formatted
nextCursor
that you receive and then feed it back into the samegetAllOrders()
to get the subsequent pages. It might be useful to include a helper or utility class in this library to make this easy for people. But this seems like a nice to have not really necessary.One thing I don't love about this solution is that i had to set all of the parameters for the
v3/orders
endpoint in the schema-customizations.json. Ideally I could just set the additional missing parameters and these would get merged with the others for this particular problem. It might be a good idea to addresources/scehema-additions.json
that usesarray_merge_recursive
under the hood to add to the schemas during schema customization. Just a thought though. This seems good enough to me for now