erstegg
erstegg

Reputation: 21

creating a web application using swagger API documentation

i have recently read few tutorials on swagger and its implementation. I am very much a newbie in web development and my ultimate goal is to use hyperledger for my blockchain project.

So, i followed a swagger tutorial and created the enivornment in my CentOS machine for swagger-ui and it is working absolutely fine because I can visit, localhost:5554/swagger-ui/dist and explore my rest json api which is provided by hyperledger here,

https://github.com/hyperledger/fabric/blob/master/core/rest/rest_api.json

I can explore the entire API by providing different inputs and observing outputs but I am confused on how can I use it to design the client side web application for it. here, https://github.com/hyperledger/fabric/blob/master/docs/API/CoreAPI.md#using-swagger-js-plugin

it says that

You can interface with the peer process from a Node.js application. One way to accomplish that is by relying on the Swagger API description document, rest_api.json and the swagger-js plugin.

I do have peer process running in a vagrant environment and i have also setup swagger and swagger-ui but how can i use swagger API description to develop a web based application for the client side ?

Upvotes: 2

Views: 1231

Answers (1)

MarcC
MarcC

Reputation: 610

Swagger is just a way to discover the API exposed by your service and play with it.

Check online material to learn how to build a client application in the language of your choice invoking this API. In JavaScript (from the browser or from a Node.js server) the call is pretty straightforward, however it works fine as well with Java, Python and many others.

Upvotes: 1

Related Questions