Skip to content

Commit 8d46672

Browse files
fix: add support for required query params in node (#596)
<!-- We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines, then fill out the blanks below. Please format the PR title appropriately based on the type of change: <type>[!]: <description> Where <type> is one of: docs, chore, feat, fix, test, misc. Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature). **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.** Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged! e.g. Fixes #1 Closes #2 --> # Fixes # In twilio-node, read operation does not handle required query params correctly, see [here](https://github.com/twilio/twilio-oai-generator/blob/main/src/main/resources/twilio-node/api-single.mustache#L139). Till now, the existing APIs do not have such use case, but now some APIs are trying to pass required query params. This needs to be supported in twilio-node. ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] Run `make test-docker` - [ ] Verify affected language: - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [build_twilio_go.py](./examples/build_twilio_go.py) using `python examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-go` and inspect the diff - [ ] Run `make test` in `twilio-go` - [ ] Create a pull request in `twilio-go` - [ ] Provide a link below to the pull request - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please create a GitHub Issue in this repository.
1 parent 81057f9 commit 8d46672

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/resources/twilio-node/listInterfaceFunctions.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @param { {{vendorExtensions.x-resource-name}}EachOptions } [params] - Options for request
1414
* @param { function } [callback] - Function to process each record
1515
*/
16-
each(callback?: (item: {{instanceName}}, done: (err?: Error) => void) => void): void;
16+
{{^hasRequiredParams}}each(callback?: (item: {{instanceName}}, done: (err?: Error) => void) => void): void;{{/hasRequiredParams}}
1717
each(params: {{vendorExtensions.x-resource-name}}EachOptions, callback?: (item: {{instanceName}}, done: (err?: Error) => void) => void): void;
1818
/**
1919
* Retrieve a single target page of {{instanceName}} records from the API.
@@ -33,7 +33,7 @@
3333
* @param { {{vendorExtensions.x-resource-name}}Options } [params] - Options for request
3434
* @param { function } [callback] - Callback to handle list of records
3535
*/
36-
list(callback?: (error: Error | null, items: {{instanceName}}[]) => any): Promise<{{instanceName}}[]>;
36+
{{^hasRequiredParams}}list(callback?: (error: Error | null, items: {{instanceName}}[]) => any): Promise<{{instanceName}}[]>;{{/hasRequiredParams}}
3737
list(params: {{vendorExtensions.x-resource-name}}Options, callback?: (error: Error | null, items: {{instanceName}}[]) => any): Promise<{{instanceName}}[]>;
3838
/**
3939
* Retrieve a single page of {{instanceName}} records from the API.
@@ -46,5 +46,5 @@
4646
* @param { {{vendorExtensions.x-resource-name}}PageOptions } [params] - Options for request
4747
* @param { function } [callback] - Callback to handle list of records
4848
*/
49-
page(callback?: (error: Error | null, items: {{returnType}}) => any): Promise<{{returnType}}>;
49+
{{^hasRequiredParams}}page(callback?: (error: Error | null, items: {{returnType}}) => any): Promise<{{returnType}}>;{{/hasRequiredParams}}
5050
page(params: {{vendorExtensions.x-resource-name}}PageOptions, callback?: (error: Error | null, items: {{returnType}}) => any): Promise<{{returnType}}>;

0 commit comments

Comments
 (0)