OpenAPITools / OpenAPITools/openapi-generator
[typescript] filter is not used
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
By generating the openapi file of Loopback 4, each route can contain a filter. It is well generated by the generator, but in the code it is not used. (Tested with Axios, fetch in TypeScript)
Describe the solution you'd like
When a function waits for a filter, this should be sent in the request
Additional context
projectControllerFind(filter?: object, options: any = {}): RequestArgs {
const localVarPath = `/projects`;
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (filter !== undefined) {
localVarQueryParameter['filter'] = filter;
}
localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query};
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers};
return {
url: globalImportUrl.format(localVarUrlObj),
options: localVarRequestOptions,
};
}
Request example :
localhost:3000/users?filter[where][name]=test
localhost:3000/users?filter[limit]=5
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the generated TypeScript client method shown in the issue and trace how its query parameters are serialized. Add coverage for filter values such as filter[where][name] and filter[limit], and verify that generated requests include the filter in the URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100