Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !175

WIP: new javascript flowtyped generator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/jaypea/js-flow-typed into master May 29, 2018
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 12

Created by: cnx-bot

As discussed in https://github.com/swagger-api/swagger-codegen/issues/5733 there is no generator which outputs Javascript which is properly flow typed and easy to use with React.

Here is it now.

Is is based on the Typescript Fetch Generator, so differs from the other Javascript Generators in code and architecture.

Simply adding flow annotations didn't work with the current js es6 code.

The code is written in ES6 with flow syntax. In order to use it as a library in your react app, it comes with a npm build script to transpile it into node.js and browser compatible es5 syntax with additional .js.flow for flow to use the types properly.

steps to use this client as a npm library:

create yourself a new folder and repo for the client sdk generate client with java -jar swagger-codegen-cli-2.3.1.jar generate -i swagger.json -l javascript-flowtyped -o npm install NODE_ENV=production npm run build git add . git commit -m 'update sdk version' git tag v git push && git push --tags in your react app do: npm install #v import { * as api } from 'client-sdk-package' if you want to generate the api directly inside your client-app you can do so. just import the files from the generated src then. these are pure es6 with flow types and need to be transpiled like you would do with the other code.

see https://github.com/swagger-api/swagger-codegen/pull/8101 for reference and discussion.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jaypea/js-flow-typed