Skip to content

Commit

Permalink
feat: add --argumentStyle option
Browse files Browse the repository at this point in the history
* feat: add --argumentStyle option

* fix: handle empty params case, add tests

* fix(gen): generate demo

* fix: follow upstream changes
  • Loading branch information
Liooo committed Jan 15, 2024
1 parent 798de66 commit 8582f50
Show file tree
Hide file tree
Showing 7 changed files with 1,053 additions and 53 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Options:
--optimistic
--useEnumType
--mergeReadWriteOnly
--argumentStyle=<positional | object> (default: positional)
```

Where `<spec>` is the URL or local path of an OpenAPI or Swagger spec (in either json or yml) and `<filename>` is the location of the `.ts` file to be generated. If the filename is omitted, the code is written to stdout.
Expand All @@ -48,6 +49,8 @@ Where `<spec>` is the URL or local path of an OpenAPI or Swagger spec (in either

- `--mergeReadWriteOnly` by default oazapfs will generate separate types for read-only and write-only properties. This option will merge them into one type.

- `--argumentStyle` if "object" generated functions take single object style argument for parameters and requestBody, by default it's "positional" and parameters are separate as positional arguments

## Consuming the generated API

For each operation defined in the spec the generated API will export a function with a name matching the `operationId`. If no ID is specified, a reasonable name is generated from the HTTP verb and the path.
Expand Down
Loading

0 comments on commit 8582f50

Please sign in to comment.