Comparing version 0.0.1 to 0.0.2
10
index.js
#!/usr/bin/env node | ||
let fs = require("fs"); | ||
let path = require("path"); | ||
let License = require("./api_units/License"); | ||
@@ -26,4 +28,6 @@ let Info = require("./api_units/Info"); | ||
"use strict"; | ||
this.config = JSON.parse(fs.readFileSync(config_file)); | ||
this.cs = JSON.parse(fs.readFileSync((this.config.contract))); //cs = contract_schema | ||
let config_path = path.dirname(config_file); | ||
this.config = JSON.parse(fs.readFileSync(config_file)); | ||
let contract_path = path.join(config_path, this.config.contract); | ||
this.cs = JSON.parse(fs.readFileSync(contract_path)); //cs = contract_schema | ||
} | ||
@@ -107,3 +111,3 @@ | ||
} | ||
}, | ||
} | ||
@@ -110,0 +114,0 @@ /** |
{ | ||
"name": "abi2oas", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Ingests a smart contract's ABI and autogenerates OpenAPI JSON, ready for Swagger codegen.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# abi2oas | ||
Ingests a smart contract's [ABI](https://solidity.readthedocs.io/en/develop/abi-spec.html) and autogenerates [OpenAPI](https://swagger.io/specification/) JSON, ready for [Swagger](https://swagger.io/) codegen. | ||
Ingests a smart contract's [ABI](https://solidity.readthedocs.io/en/develop/abi-spec.html) and autogenerates a JSON conforming to the [OpenAPI Spec](https://swagger.io/specification/), ready for [Swagger](https://swagger.io/) codegen. | ||
@@ -37,3 +37,3 @@ ## Usage | ||
### Config | ||
The config JSON includes the path to the contract, ethereum options, and swagger options. | ||
The config JSON includes the path to the contract, ethereum options, and swagger options. The path to the contract should be relative to the location of the config file. | ||
@@ -40,0 +40,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40006
799