Swagger-codegen: [JavaScript] Add support for Fetch

Created on 25 Apr 2017  路  2Comments  路  Source: swagger-api/swagger-codegen

Description

Simliar to Typescript, we want to add support of Fetch to JS API client with a library option so that developers can choose which one to use: superagent (default) or fetch.

Swagger-codegen version

Latest master

Suggest a Fix

If anyone wants to work on this enhancement, let us know and we'll show you some good starting points.

JavaScripNode.js Feature help wanted

Most helpful comment

@wing328 I think to be true to node.js culture, the API client base implementation and default implementation should be published to npm separately.

For example:

  1. swagger-apiclient-base
  2. swagger-apiclient-http

Then, separate projects (outside of swagger-codegen) could extend swagger-apiclient-base to maintain and publish other versions like a swagger-apiclient-fetch or swagger-apiclient-tcp.

All 2 comments

FYI. For PHP, we've recently added the support of https://github.com/php-http/httplug, which is an HTTP abstraction layer allowing developers to use their favorite HTTP clients.

I'm not aware of something similar in NodeJS but am open to suggestions on other HTTP libraries in JS.

@wing328 I think to be true to node.js culture, the API client base implementation and default implementation should be published to npm separately.

For example:

  1. swagger-apiclient-base
  2. swagger-apiclient-http

Then, separate projects (outside of swagger-codegen) could extend swagger-apiclient-base to maintain and publish other versions like a swagger-apiclient-fetch or swagger-apiclient-tcp.

Was this page helpful?
0 / 5 - 0 ratings