open-api-to-schema
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -19,3 +19,3 @@ "use strict"; | ||
let required = Required.RESPECT; | ||
const schema = { definitions: {}, paths: {} }; | ||
let schema = { definitions: {}, paths: {} }; | ||
function getRequiredObj(definition) { | ||
@@ -82,2 +82,6 @@ switch (required) { | ||
function convert(filePath, config) { | ||
definitions = {}; | ||
fields = {}; | ||
required = Required.RESPECT; | ||
schema = { definitions: {}, paths: {} }; | ||
if (!fs_1.default.existsSync(filePath)) { | ||
@@ -84,0 +88,0 @@ throw Error(`Could not find swagger file at: ${path_1.default.resolve(filePath)}`); |
{ | ||
"name": "open-api-to-schema", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Open API / Swagger file to JSON Schema Converter", | ||
@@ -8,6 +8,6 @@ "main": "dist/index.js", | ||
"start": "ts-node-dev --inspect src/index.ts", | ||
"build": "tsc -p .", | ||
"build": "tsc --declaration -p .", | ||
"test": "jest" | ||
}, | ||
"keywords": [ "open-api", "swagger", "json-schema" ], | ||
"keywords": [ "open-api", "swagger", "json-schema", "converter", "validation" ], | ||
"author": "Dominic Ginger", | ||
@@ -28,4 +28,4 @@ "license": "MIT", | ||
"files": [ | ||
"dist/index.js" | ||
"dist/" | ||
] | ||
} |
@@ -56,3 +56,11 @@ # Open api schema converter | ||
``` | ||
## Features | ||
- [X] Allof | ||
- [ ] Oneof | ||
- [ ] Anyof | ||
- [X] Expose definitions | ||
- [X] Expose paths | ||
- [X] Override requiring | ||
## Example Response | ||
@@ -210,1 +218,2 @@ ```json | ||
``` | ||
14900
5
142
218