swagger-js-react-native-codegen
A Swagger codegen for React Native JavaScript
Last updated 4 years ago by ajk4 .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install swagger-js-react-native-codegen 
SYNC missed versions from official npm registry.

This project is not production-quality code.

I found two relevant projects on Github. First one generated API objects only. Second one generated only Models. And they did not work with React native.

I glued together those two projects adjusted them to work with react native. Because of this usage is a little bit awkward. I'm going to unify code in the future.

This is mostly for my use. But I'm sharing anyways - it might be usefull for some people.

Generating APIs

var fs = require('fs');
var CodeGen = require('swagger-js-react-native-codegen').CodeGen;

var file = './swagger-codegen/swagger.json';
var swagger = JSON.parse(fs.readFileSync(file, 'UTF-8'));
var nodejsSourceCode = CodeGen.getNodeCode({ className: 'Api', swagger: swagger });

fs.writeFile("./swagger-codegen/Api.js", nodejsSourceCode);

Generating models

Check swagger-codegen-models/README.md file

Current Tags

  • 0.1.4                                ...           latest (4 years ago)

4 Versions

  • 0.1.4                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 5
Last Month 3
Dependencies (4)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |