-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Contributing to Development of this tool | ||
|
||
The general flow of the app is: | ||
|
||
1. parse args & read in the spec using `elm-pages` | ||
1. generate the Elm code with `elm-codegen` | ||
1. write it to disk using `elm-pages`. | ||
|
||
## Getting Started | ||
|
||
- Clone this repo | ||
- Inside your cloned repo, run `direnv allow` | ||
- Start coding! | ||
- Run `npm run dev <path to oas spec>` | ||
- e.g. `npm run dev ./example/github-spec.json` will produce `generated/GitHub_v3_REST_API.elm` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Using the CLI | ||
|
||
### Install the CLI: | ||
- `npm install -D elm-open-api` | ||
|
||
### Run the CLI: | ||
- `node elm-open-api ./page/to/oas.json` | ||
|
||
### Arguments you can pass: | ||
|
||
- `<entryFilePath>`: The path to the Open API Spec, either `.json` or `.y[a]ml` | ||
- Technically the OAS allows for parts of a spec to be in separate files, but this isn't supported yet. | ||
- `[--output-dir <output dir>]`: The directory to output to. Defaults to `generated/`. | ||
- `[--module-name <module name>]`: The Elm module name. Default to `<OAS info.title>`. | ||
- `[--generateTodos <generateTodos>]`: Whether to generate TODOs for unimplemented endpoints, or fail when something unexpected is encountered. Defaults to `no`. To generate `Debug.todo ""` instead of failing use one of: `yes`, `y`, `true`. |