Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make all WM Headers Optional #163

Open
josh-fisher opened this issue Dec 13, 2022 · 0 comments
Open

feat: make all WM Headers Optional #163

josh-fisher opened this issue Dec 13, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@josh-fisher
Copy link
Contributor

The current generation takes a Walmart OpenApi spec and generates the required WM headers on every API function. This is due to how walmart has these required as part of each API call.

It would be great if we could update all these to optional using ts-morph after the generation is finished and then use interceptors to intercept each function call and add these in for the user automatically.

This would make so that we no longer have to do the following

await itemsApi.getAnItem({
	id: '4390580943850',
	productIdType: 'SKU',
	authorization: '',
	wMSECACCESSTOKEN: '',
	wMQOSCORRELATIONID: '',
	wMSVCNAME: ''
});

or

await itemsApi.getAnItem({
  ...defaultParams,
  id: '4390580943850',
  productIdType: 'SKU',
});

and can simply do

await itemsApi.getAnItem({
  id: '4390580943850',
  productIdType: 'SKU',
});
@josh-fisher josh-fisher added the enhancement New feature or request label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant