1.0.2 • Published 1 year ago

openapi-datamodel v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

This CLI tool visualizes the schemas described in an OpenAPI Specification. It borrows some of the UML Class Diagram notations.

https://www.plantuml.com/plantuml/svg/hPL1RnCn48Nl-okiSg65H2JSUa1DJt01H2Kk24LEFBknwhKJUvOIeF-T3M5vYjUEUw2NAZD-tppRivwRmD9prvfgRMG8GbmyznGknLlD5-BPmqOpYP_LOvJzA1iwl-AzKuHq9Vg_Oq8hSIq2UsqRH8MLBI4UmpghgDQMr5BQ_OTwELjAO_h_ysG5tcyfLSD8g_f8drevPqZQKPtFv8DszfsjNPByxPXFmTUU99EwtPz9BZYLxBOgeKGoLiQc5o4GHvTHEB_vt_ER9NVPFUMAoiTTQqDt-iSXforJGtxawxPRtnCdJTnJ-YHTPxbFsAvTZO0lFUqkXMmQJuraxMpeqKOt6rwPZe3V7KsZ4P30FIQpkAjy4zsHzElD9mhRtW2bEzInDFsLXTHEOF2V_JqPunuEY1SdEmWuebY_bPuiPmbOacVWBDAKQ56Hi-0H1oTRUzU2W3YxFBTrIjUwP12hogJ_Rd7NaK-uWvQ-SrxjlA93uWnWjKzPKjhJchMpfGOfzySvGdFUM_In8Y5h9fy3umlQTHJ63X-hU0XDfx_U274wUgx5nQlfT3OU7NZwgl9qkPfCCkGhV65PFqL-oUIy08z6LWdt6hW_gCaNvPX9VPq0YL9v732OFR1Lc3YWfbUawULD8-OAsupeUKVWH6zwt1UWN8cDHa-a1XAa684SDLM-CCGf-h2Lg6Hr-XZ10GR9OE3ugo0PMZzoNPHXdWn2H69fKhd0PI6IAneF2LH5Q2HEQr4N8HIEtYim01xanrybPVJw3s84IkqLtrJSNkNwJ--kCWkpOY0CFwiRigfhpMy0

The white classes are describing the data structures of data apearing in the response payloads of the the API. The light yellow classes describe the data structures of the data sent through the reponse body of a specific API operation. The light blue classes are describing the concepts appearing in both request and response bodies. In some cases, the same concept can appear in both the send and receieved data, however with different properties. In this example, the aggregations concept appear in both written and read data. However the written one does't have any propoerties of primitive data type.

The arrows shapes distinguish the different relationships between the datamodel's concepts.

To install:

npm i openapi-datamodel -g

CLI Options:

Options:
  -V, --version          output the version number
  -i, --input <input>    input file
  -o, --output <output>  output file
  -d, --details          show details
  -res, --responses      show only responses dm
  -req, --requests       show only requests dm
  -m, --merge            merge requests and responses
  -h, --help             display help for command

example:

  • To generate a plantUML visualization of the whole datamodel:

    rdm -i https://raw.githubusercontent.com/boscore/ibc_plugin_eos/aa7fcb10d07593891ae8f50871dd31decf79d1ba/plugins/chain_api_plugin/chain.swagger.yaml  -o output.puml
- To generate a plantUML visualization of the part of datamodel representing the data that is sent in the request bodies of the operations, use the  `-req` option :

rdm -i https://raw.githubusercontent.com/boscore/ibc_plugin_eos/aa7fcb10d07593891ae8f50871dd31decf79d1ba/plugins/chain_api_plugin/chain.swagger.yaml -o output.puml -req

- To generate a plantUML visualization of the part of datamodel representing the data that is sent back to the client in the responses, use the  `-res` option :

rdm -i https://raw.githubusercontent.com/boscore/ibc_plugin_eos/aa7fcb10d07593891ae8f50871dd31decf79d1ba/plugins/chain_api_plugin/chain.swagger.yaml -o output.puml -res