Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "abi2oas", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Ingests a smart contract's ABI and autogenerates an OpenAPI JSON, ready for Swagger codegen.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# abi2oas | ||
**WARNING (2018-04-12): This library is still a work in progress, not yet fully functional. API may change over time.** | ||
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 Codegen](https://swagger.io/swagger-codegen/). | ||
@@ -25,4 +23,4 @@ | ||
### Node.js (under construction) | ||
You can also use `abi2oas1` directly within node. Install directly to your project: | ||
### Node.js | ||
You can also use `abi2oas` directly within node. Install directly to your project: | ||
@@ -32,2 +30,4 @@ ``` | ||
// OR | ||
yarn add abi2oas | ||
@@ -37,10 +37,9 @@ ``` | ||
Import like any other package, then use the `convert` method to build the OpenAPI object: | ||
```nodejs | ||
```javascript | ||
const abi2oas = require('abi2oas'); | ||
const contractApiSpec = abi2oas.convert({ | ||
version : '1.0.0', | ||
contract : '<path_to_contract.json>' | ||
}); | ||
const contractApiSpec = abi2oas.convert(<path_to_contract.json>, <output_path.json>, [config]); | ||
``` | ||
`.convert()` runs synchronously and returns the serialized object corresponding to the OpenAPI JSON. `config` in this method may either be an object or a string pointing to a config JSON. Read below for config spec. | ||
@@ -47,0 +46,0 @@ ## Method Mapping |
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
44889
108