sp-api-sdk icon indicating copy to clipboard operation
sp-api-sdk copied to clipboard

Map all headers back to original headers

Open johncarlson21 opened this issue 2 years ago • 3 comments

While converting over from MWS to the new SP-API I'm using the library and calling getOrders(), which returns the orders list. However it looks like you are converting all the headers over to your own headers.

Example: AmazonOrderId => amazon_order_id

I would like these to stay the same as they are originally from Amazon, which is the camel case. This way when I retrieve data, I don't have to go through and change all the headers over, or change all of my code to look for the new headers.

Not sure why this is mapped this way, however there should be a way to revert it.

johncarlson21 avatar May 25 '23 15:05 johncarlson21

Hey, you are more than welcome to contribute and make it possible to disable converting headers :) I'm currently busy with other projects and this is not very high priority so I cant say when I will be able to look into this

norberttech avatar May 26 '23 08:05 norberttech

I am just wondering why it is converting it.. is this part of the auto generated code? I'm sure you're busy man.. I totally understand. I could go ahead and try to figure it out myself but I do not want to change any of the stuff that will get overwritten as I don't really understand how this code is auto generated.

johncarlson21 avatar May 26 '23 12:05 johncarlson21

I'm honestly not sure why this is being converted, it was quite a while ago since I built it :( I might be able to take a look next week to see what's happening there

norberttech avatar May 26 '23 12:05 norberttech

This is auto-generated code from the OpenAPI Spec file provided by Amazon.

jasonhebert avatar Jul 09 '24 16:07 jasonhebert