Giter Club home page Giter Club logo

abi2api's People

Contributors

john-osullivan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

abi2api's Issues

Returns Sample Values

I wanted to try this out...

Took me a while to get it running, here my quickfixes:

  • Give absolute path in SwaggerServiceGenerator.js to SwaggerService_template.hbs (might be a macOS issue)
  • Give absolute path in abi2api/index.js to swagger-codegen-cli.jar (might be a macOS issue)
  • abi2api.js fixed by changing the lib path to: parser.process(path.basename(contract_path, '.json') + "/" + path.basename(contract_path, '.json') + "ContractLib" + "/" + path.basename(contract_path, '.json') + "Controller.js") -> this totally is a bug or compatibility issue, right? It was "contract_lib" hardcoded and that directory didn't exist

Now I have my api under http://localhost:8080/docs but it seems to return just example values every time. Also the GET requests do not add parameters as I would expect them to (also doesn't work if I try it manually). In code the parameter seem to never reach the method (empty object)

Just wanted to ask if this project is incomplete from where I now stand or if there might be other things to fix?

Automagical Swagger UI

If we want to really put the cherry on top of all this magic, then we need to take that server generated by Swagger Codegen and boot it up with Swagger UI. Not sure of all the details, but I think that if we hook it up right and there's a running geth instance, we might be able to get a GUI for a smart contract in one command. Proposed syntax is:

abi2api  <path_to_contract_json> <server_output_folder> --extra-magic

It would generate the server output, run that server, run a Swagger UI installation to speak with it, and then open up the browser. Run one command and BAM, you GUI.

We're already generating the server stub and hooking it up with working geth interactions, last step is figuring out how to make Swagger UI pass requests over to that server. Some helpful links:

  • Configuring Swagger UI - Looks like the most important thing is just passing the path to the swagger.yaml, but it isn't clear if it'll auto-detect a real server.
  • Installing Swagger UI - There are two ways to install -- one is meant to be server-side, the other expects to be able to use a bundler in order to pull in additional assets. We want to use the latter, as it results in much less total code. Need to figure out how minimal a bundler we can automagically generate with our API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.