Commit Graph

25 Commits

Author SHA1 Message Date
Adam Leventhal d4decd4728
Mock code doesn't compile if path parameters are renamed (#782) 2024-04-22 09:51:38 -07:00
Sophie Tauchert a1de78dbeb
Add support for text/plain and text/x-markdown body content types (#593) 2023-10-16 11:47:50 -07:00
Ian Nickles 6dc2a0ff2d
Generate unique internal var names and add tests for name collisions. (#601)
* Generate unique identifiers for internal variable names instead of using a
static prefix.

* Add tests for previous name collision issues.

* only prefix when needed.

Co-authored-by: Adam Leventhal <ahl@oxide.computer>

* add missing test invocation.

* update test fixtures per aaa40855485ca3c2ccf338c07d595ffc907975a1.

---------

Co-authored-by: Adam Leventhal <ahl@oxide.computer>
2023-10-16 11:44:24 -07:00
Adam Leventhal 66c890807f
CLI: improve required settings for paginated operations (#469) 2023-05-15 08:59:07 -07:00
Adam Leventhal 87749a11ee
update for new dropshot pagination format (#465) 2023-05-08 11:16:48 -07:00
John Vandenberg c965167e7e
Add sample_openapi/README.md (#443)
* Add sample_openapi/README.md

* Update sample_openapi/README.md

Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>

* Update sample_openapi/README.md

Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>

---------

Co-authored-by: Adam Leventhal <adam.leventhal@gmail.com>
2023-04-28 08:54:45 -07:00
Douglas Dwyer 24862f92e0
Allow for parameters in content types (#430) 2023-04-25 22:09:05 -07:00
Adam Leventhal 88ff3cf1e0
update typify and nexus.json (#323) 2023-01-31 21:28:12 -08:00
John Vandenberg 1ef131a244
Add yaml support (#227) 2023-01-14 08:58:57 -08:00
Artem Medvedev e34756583a
feat: support header parameters (#210) 2023-01-04 11:14:37 -08:00
Augustus Mayo 12d4adbc6c
Path level parameters (#262) 2022-12-01 22:50:50 -08:00
liffy 4e2dcc5365
Generate a Client method for Dropshot websocket channels (#183)
Generated methods return `ResponseValue<reqwest::Upgrade`, which may be
passed to a websocket protocol implementation such as
`tokio_tungstenite::WebSocketStream::from_raw_stream(rv.into_inner(), ...)`
for the purpose of implementing against the raw websocket connection, but
may later be extended as a generic to allow higher-level channel message
definitions.

Per the changelog, consumers will need to depend on reqwest 0.11.12 or
newer for HTTP Upgrade support, as well as base64 and rand if any
endpoints are websocket channels:
```
[dependencies]
reqwest = { version = "0.11.12" features = ["json", "stream"] }
base64 = "0.13"
rand = "0.8"
```

Co-authored-by: lif <>
2022-09-28 13:40:07 -07:00
Adam Leventhal ea5a6a5a79
update nexus and typify (#142) 2022-07-26 21:23:01 -07:00
Adam Leventhal bfd194f39c
Change builder methods for setting a parameter with type T to accept a TryInto<T> (#133)
This makes constrained types a bit more
ergonomic and will allow us to accept fallible builders more easily
2022-07-18 11:55:21 -07:00
Adam Leventhal 9f6f940705
update nexus openapi (#126) 2022-07-14 20:59:36 -07:00
dependabot[bot] 75519247fa
Bump typify from `7b5f72b` to `f58c5e2` (#117)
* Bump typify from `7b5f72b` to `f58c5e2`

Bumps [typify](https://github.com/oxidecomputer/typify) from `7b5f72b` to `f58c5e2`.
- [Release notes](https://github.com/oxidecomputer/typify/releases)
- [Commits](7b5f72b1e4...f58c5e23b1)

---
updated-dependencies:
- dependency-name: typify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixups and output update

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam H. Leventhal <ahl@oxide.computer>
2022-07-12 10:57:06 -07:00
Adam Leventhal 03e2cfad3c
add support for application/x-www-form-urlencoded bodies (#109)
* add support for application/x-www-form-urlencoded bodies

* self review

* alphabetizing

* remove commented code

* update changelog
2022-07-07 18:35:36 -07:00
Adam Leventhal 3bc3d5972b
update nexus spec (#72) 2022-05-23 08:49:37 -07:00
Adam Leventhal 75348207d7
improve rustdoc output for generated crates (#37) 2022-03-17 23:54:10 -07:00
Adam Leventhal ea80069ef3
Handle byte streams for both success and error responses (#35) 2022-03-15 16:11:47 -07:00
Adam Leventhal 25192b5dc1
Add a wrapper types for success and error responses (#26) 2022-02-08 08:59:38 -08:00
Adam Leventhal e47fc93748
generate iterators over dropshot paginated interfaces (#19)
* Adds support for interating with Streams over interfaces that are tagged
with the x-dropshot-pagination extension. This requires clients to use
the futures crate.

Adds tests that compile generated clients.

Updates nexus.json to reflect a more recent omicron API.

Changes all generated methods to have a lifetime ('a) bound on all
references. This isn't necessary for most methods, but greatly
simplifies generation of the associated paginated interface.
2022-01-05 12:02:46 -08:00
Adam Leventhal e58ebd18fa
introduce an intermediate form (#18)
introduce an intermediate form; this is going to be used to generate a few different things:
- an interator interface for paginated APIs; the IR will let us re-use
  the typify types
- a CLI generator that will generate calls into the generated client
- an automated test harness that will validate the generated client
  against a mock server
2021-12-09 18:15:24 -08:00
Adam H. Leventhal 75b224c047 Handle operations whose response is a `null` 2021-11-09 23:27:07 -08:00
Adam Leventhal 97857c347c
convert from executable -> executable + library with macro and builder options (#9) 2021-10-17 10:40:22 -07:00