Skip to content

Commit

Permalink
support args
Browse files Browse the repository at this point in the history
  • Loading branch information
igtm committed Oct 26, 2022
1 parent 7ea8299 commit ae6625d
Show file tree
Hide file tree
Showing 8 changed files with 847 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .gitignore
@@ -1,6 +1,6 @@
/target
/out
openapi-yup-generator-settings.jsonc
openapi3.yaml
yup-defs.*
openapi-yup-generator
/openapi-yup-generator-config.jsonc
/openapi3.yaml
/yup-defs.*
/openapi-yup-generator
98 changes: 98 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Expand Up @@ -2,10 +2,14 @@
name = "openapi-yup-generator"
version = "0.1.0"
edition = "2021"
authors = ["igtm"]
description = "CLI tool for generating yup definitions from openapi3.yaml"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.0.18", features = ["derive"] }
convert_case = "0.6.0"
jsonc-parser = "0.21.0"
oas3 = "0.2.1"
23 changes: 20 additions & 3 deletions README.md
Expand Up @@ -2,14 +2,31 @@

CLI tool for generating yup definitions from openapi3.yaml

# Install

//TBD

# Usage

```
Usage: openapi-yup-generator [OPTIONS]
Options:
-f, --file <FILE> openapi3 yaml file name
-o, --out <OUT> output file name
-c, --config <CONFIG> config file name
-h, --help Print help information
-V, --version Print version information
```

# Settings

place `openapi-yup-generator-settings.jsonc` on your working directory
place `openapi-yup-generator-config.jsonc` on your working directory

```jsonc
{
// "description_as_label": false,
// "input": "openapi3.yaml",
// "output": "yup-defs.js",
// "file": "openapi3.yaml",
// "out": "yup-defs.js",
}
```
5 changes: 5 additions & 0 deletions examples/openapi-yup-generator-config.jsonc
@@ -0,0 +1,5 @@
{
"description_as_label": false,
"input": "openapi3.yaml",
"output": "yup-defs.js"
}

0 comments on commit ae6625d

Please sign in to comment.