Skip to content

[TS][Fetch] Fix Typescript errors with 'strictNullChecks' mode enabled#4658

Merged
wing328 merged 1 commit intoswagger-api:masterfrom
megaboich:typescript-fetch-imrovements
Jan 29, 2017
Merged

[TS][Fetch] Fix Typescript errors with 'strictNullChecks' mode enabled#4658
wing328 merged 1 commit intoswagger-api:masterfrom
megaboich:typescript-fetch-imrovements

Conversation

@megaboich
Copy link
Copy Markdown
Contributor

error TS2454: Variable 'contentTypeHeader' is used before being assigned.
error TS2345: Argument of type 'FetchAPI | undefined' is not assignable to parameter of type 'FetchAPI'.

Description of the PR

According to issue #4657

error TS2454: Variable 'contentTypeHeader' is used before being assigned.
error TS2345: Argument of type 'FetchAPI | undefined' is not assignable to parameter of type 'FetchAPI'.
@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 26, 2017

@megaboich thanks for the PR. Please run ./bin/typescript-fetch-petstore-all.sh to update Petstore sample for TS Fetch API client so that the CIs can verify the change.

@megaboich
Copy link
Copy Markdown
Contributor Author

Dear wing328,

It is my first time I do PR for this project, so I am trying my best.
Anyway I do not have currently linux environment handy, so I tried to execute windows version of script via command:

bin\windows\typescript-fetch.bat

It did generate me whole new folder inside samples\client\petstore\typescript-fetch\

01/26/2017  05:05 PM                37 .gitignore
01/26/2017  05:05 PM             1,030 .swagger-codegen-ignore
01/26/2017  05:05 PM            50,705 api.ts
01/26/2017  10:26 AM    <DIR>          builds
01/26/2017  05:05 PM             1,716 git_push.sh
01/26/2017  05:05 PM               479 package.json
01/26/2017  05:05 PM             2,548 README.md
01/26/2017  10:26 AM    <DIR>          tests
01/26/2017  05:05 PM               307 tsconfig.json
01/26/2017  05:05 PM             2,384 tslint.json
01/26/2017  05:05 PM               274 typings.json
              10 File(s)         59,480 bytes
               4 Dir(s)  103,660,347,392 bytes free

Should I commit this files to my forked repository or I just did something wrong. It kind of unsettling that files did not exist before.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 26, 2017

It is my first time I do PR for this project, so I am trying my best.

@megaboich I think you're doing a very good job.

Should I commit this files to my forked repository or I just did something wrong. It kind of unsettling that files did not exist before.

No need. Let me update the Petstore sample for you and see how it goes.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 26, 2017

@megaboich the test results with the updated Petstore samples look good. I'll merge this later if no one has further feedback/question.

cc @leonyu

@wing328 wing328 merged commit d82c2bb into swagger-api:master Jan 29, 2017
@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jan 29, 2017

@megaboich thanks for your contribution, which has been merged into master.

(we've added Swagger Codegen to ProductHunt: https://www.producthunt.com/posts/swagger-codegen, pleae upvote if you find Swagger Codegen useful)

@megaboich megaboich deleted the typescript-fetch-imrovements branch February 1, 2017 09:16
@megaboich
Copy link
Copy Markdown
Contributor Author

Well, thanks a lot!

@wing328 wing328 changed the title Fix Typescript errors with 'strictNullChecks' mode enabled [TS][Fetch] Fix Typescript errors with 'strictNullChecks' mode enabled Feb 20, 2017
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
…pi#4658)

error TS2454: Variable 'contentTypeHeader' is used before being assigned.
error TS2345: Argument of type 'FetchAPI | undefined' is not assignable to parameter of type 'FetchAPI'.
@ka2n
Copy link
Copy Markdown

ka2n commented Aug 12, 2017

Is this fix reverted on current master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants