oxidecomputer / oxidecomputer/progenitor
PagerDuty REST Api generation fails
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 136
- Avg merge
- 8h 36m
- Merged PRs (30d)
- 14
Description
I'm trying to use progenitor to generate a PagerDuty API client using their published OpenAPI v3 spec from here openapiv3.json
I have these dependencies in my Cargo.toml:
[dependencies]
futures = "0.3"
progenitor = { version = "0.4" }
reqwest = { version = "0.11", features = ["json", "stream"] }
serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1.0.0", features = ["serde", "v4"] }
base64 = "0.21"
rand = "0.8"
regress = "0.7"
And a simple lib.rs:
use progenitor::generate_api;
generate_api!("spec/openapiv3.json");
However when running cargo build I get this error:
error: proc macro panicked
--> pagerduty/src/lib.rs:3:1
|
3 | generate_api!("spec/openapiv3.json");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: not clear what we could usefully do here Schema {
schema_data: SchemaData {
nullable: false,
read_only: false,
write_only: false,
deprecated: false,
external_docs: None,
example: None,
title: None,
description: None,
discriminator: None,
default: None,
extensions: {},
},
schema_kind: Any(
AnySchema {
typ: None,
pattern: None,
multiple_of: None,
exclusive_minimum: None,
exclusive_maximum: None,
minimum: None,
maximum: None,
properties: {},
required: [],
additional_properties: None,
min_properties: None,
max_properties: None,
items: None,
min_items: None,
max_items: None,
unique_items: None,
enumeration: [
String("event_orchestration_reference"),
],
format: None,
min_length: None,
max_length: None,
one_of: [],
all_of: [],
any_of: [],
not: None,
},
),
}
error: could not compile `pagerduty` (lib) due to previous error
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the PagerDuty schema at spec/openapiv3.json and the generate_api!("spec/openapiv3.json") entry point in lib.rs, starting with cargo build. Trace how progenitor handles the reported schema containing an enum without a type; done means the PagerDuty client generation completes without the proc-macro panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100