oxidecomputer / progenitor

An OpenAPI client generator
537 stars 68 forks source link

Path to GitHub client #395

Open augustuswm opened 1 year ago

augustuswm commented 1 year ago

Currently the octorust client is generated out of the third-part-api-clients repo against an outdated GitHub spec. Ideally progenitor could be used to generate this client against the current live spec instead. This is a tracking issue to track the list of known features needed to make this possible. See the individual tickets for more details.

For reference this list was compiled against: https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.json

- [x] Add `text/x-markdown` as a supported request body type
- [ ] #396
- [ ] #344
- [ ] #397
- [ ] Duplicate structs generated from key / title collision (https://github.com/oxidecomputer/typify/issues/1 and #398)
- [ ] #398
- [ ] #268
- [ ] Support for servers parameter
- [ ] Solution for access / refresh token handling
geoffreygarrett commented 4 months ago

@augustuswm & @ahl, which of the above tasks relate to the following:

--- stdout
cargo:rerun-if-changed=./api.github.com.json
--- stderr
thread 'main' panicked at progenitor-github/build.rs:10:50:
called `Result::unwrap()` on an `Err` value: Error("data did not match any variant of untagged enum ReferenceOr", line: 65608, column: 3)

(?)

I could only find https://github.com/oxidecomputer/progenitor/issues/348. If desired my setup is as available in the zip in the PR demo https://github.com/oxidecomputer/progenitor/pull/857.

EDIT:

Seems to be the lack of support for JSON schema types in OpenAPI deserialisation.

 "type": ["string", "null"],

I guess I'll just parse it to the nullable syntax in OpenAPI for now.

ahl commented 4 months ago

Seems to be the lack of support for JSON schema types in OpenAPI deserialisation.

Yeah, that works in 3.1, but not in 3.0.x. Progenitor will support 3.1 at some point, but 1. there aren't that many 3.1 docs out there and 2. I have a stack of work I want to do in order to "propertly" support it

geoffreygarrett commented 4 months ago

@ahl I'm not sure if the project is open to PRs etc. or if development will continue, but there's this I was hoping might get a review https://github.com/oxidecomputer/progenitor/pull/857.