input-output-hk / cardanodocs.com-archived

Cardano Settlement Layer Documentation
https://cardanodocs.com
Other
35 stars 27 forks source link

[CSL-1902] Stepping stone for better wallet-api rendering #64

Closed adinapoli-iohk closed 6 years ago

adinapoli-iohk commented 6 years ago

Hey @denisshevchenko ,

this consolidates our conversation about rendering the wallet API to use the official swagger-ui package.

This is a sneak-peak on what we generate now for the wallet:

screen shot 2017-11-21 at 18 05 03

And we can easily extend this to explorer when the time will come. Note how this PR is far from perfect:

window.onload = function() {
  // Build a system
  const ui = SwaggerUIBundle({
    url: "swagger.json",
    dom_id: '#swagger-ui',
    deepLinking: true,
    presets: [
      SwaggerUIBundle.presets.apis
    ],
    plugins: []
  })

  window.ui = ui
}

Moving forward I have no reasons to believe we cannot extend our CI scripts with the help of @domenkozar to also push the updated link into this JS so that every time we deploy a new version of Cardano, the docs remains nice and consistent, and above all they are simply a remote, inspectable resource (I want in the future to commit the swagger.json in full into cardano-sl, so that we can retrieve the precise snapshot of the API at each SHA commit).

Let me know if this is a good step forward!