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

typescript-fetch: nullify url search #12330

Merged

Conversation

simeonborko
Copy link

I had a problem with strict mode in TypeScript compilation because of lines delete localVarUrlObj.search

localVarUrlObj has type Url. Field search is defined here as this: field: string | null which means it's required, cannot be undefined and thus cannot be deleted. TypeScript compiled error was: "TS2790: The operand of a  delete  operator must be optional."

Source code for the Url type: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/url.d.ts

I have also removed a semicolon after BaseAPI (unneccesary after classes) and rerun bin/{,security/}typescript-fetch-petstore.sh which were not run since 2.4.0-SNAPSHOT, so there are few more changes.

@simeonborko simeonborko changed the title Typescript fetch nullify url search typescript-fetch: nullify url search Jan 31, 2024
@funivan
Copy link

funivan commented Feb 4, 2024

👏

@HugoMario HugoMario self-assigned this Feb 10, 2024
@HugoMario
Copy link
Contributor

Thanks a lot @simeonborko for this PR

@HugoMario HugoMario merged commit 7242d20 into swagger-api:master Feb 10, 2024
10 of 12 checks passed
@simeonborko simeonborko deleted the typescript-fetch-nullify-url-search branch February 13, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants