swagger-to-flowtype
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "swagger-to-flowtype", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Command line tool for generating flow types from swagger", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -15,10 +15,75 @@ # swagger-to-flowtype | ||
`-d option` can specify the path of generated file | ||
This command generates a file named **flowtype.js** includes type definitions as default. | ||
You can also specify output path with `-d option`. | ||
`$swagger-to-flowtype <YOUR SWAGGER FILE> -d <OUTPUT FILE PATH>` | ||
## Example | ||
swagger file like following | ||
```yaml | ||
... | ||
definitions: | ||
Order: | ||
type: "object" | ||
properties: | ||
id: | ||
type: "integer" | ||
format: "int64" | ||
petId: | ||
type: "integer" | ||
format: "int64" | ||
quantity: | ||
type: "integer" | ||
format: "int32" | ||
shipDate: | ||
type: "string" | ||
format: "date-time" | ||
status: | ||
type: "string" | ||
description: "Order Status" | ||
enum: | ||
- "placed" | ||
- "approved" | ||
- "delivered" | ||
complete: | ||
type: "boolean" | ||
default: false | ||
xml: | ||
name: "Order" | ||
Category: | ||
type: "object" | ||
properties: | ||
id: | ||
type: "integer" | ||
format: "int64" | ||
name: | ||
type: "string" | ||
xml: | ||
name: "Category" | ||
... | ||
``` | ||
Output will be like below | ||
```js | ||
// @flow | ||
export type Order = { | ||
id: number, | ||
petId: number, | ||
quantity: number, | ||
shipDate: string, | ||
status: string, | ||
complete: boolean | ||
}; | ||
export type Category = { id: number, name: string }; | ||
``` | ||
## Requirements | ||
*Write later.* | ||
**Node 4+ is required** | ||
@@ -29,2 +94,1 @@ ## Tests | ||
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
93
0
105462