Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ https://github.com/oxidecomputer/progenitor/compare/v0.13.0\...v0.14.0[Full list
* Add CliCommand::operation_id() to get the original operationId (#1336)
* Treat connection upgrade (HTTP 101) as normal success. (#1320)

* Replace the `openapiv3` crate with `oas3`. Progenitor now targets
OpenAPI 3.1 documents; 3.0 documents continue to parse but their
`nullable: true` annotations are dropped silently. Bundled fixtures
under `sample_openapi/` have been migrated to 3.1 (`type: ["...",
"null"]`, numeric `exclusiveMinimum`/`exclusiveMaximum`). Regenerate
any 3.0 specs to 3.1 if their nullability is semantically
significant.


== 0.13.0 (released 2026-02-24)

https://github.com/oxidecomputer/progenitor/compare/v0.12.0\...v0.13.0[Full list of commits]
Expand Down
129 changes: 118 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ heck = "0.5.0"
http = "1.4.0"
hyper = "1.9.0"
indexmap = "2.14.0"
openapiv3 = "2.2.0"
oas3 = "0.21.0"
percent-encoding = "2.3.2"
proc-macro2 = "1.0.106"
quote = "1.0.45"
rand = "0.10.1"
regex = "1.12.3"
regress = "0.11.1"
reqwest = { version = "0.13.3", default-features = false, features = ["json", "query", "stream"] }
reqwest = { version = "0.12.28", default-features = false, features = ["json", "stream"] }
rustfmt-wrapper = "0.2.1"
schemars = { version = "0.8.22", features = ["chrono", "uuid1"] }
semver = "1.0.28"
Expand Down
4 changes: 2 additions & 2 deletions cargo-progenitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
description = "A cargo command to generate a Rust client SDK from OpenAPI"
repository = "https://github.com/oxidecomputer/progenitor.git"
readme = "../README.md"
keywords = ["openapi", "openapiv3", "sdk", "generator"]
keywords = ["openapi", "oas3", "sdk", "generator"]
categories = ["api-bindings", "development-tools::cargo-plugins"]

default-run = "cargo-progenitor"
Expand All @@ -23,7 +23,7 @@ clap = { workspace = true }
clap-cargo = { workspace = true }
env_logger = { workspace = true }
expectorate = { workspace = true }
openapiv3 = { workspace = true }
oas3 = { workspace = true }
rustfmt-wrapper = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
4 changes: 2 additions & 2 deletions cargo-progenitor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{

use anyhow::{Result, bail};
use clap::{Parser, ValueEnum};
use openapiv3::OpenAPI;
use oas3::Spec;
use progenitor::{GenerationSettings, Generator, InterfaceStyle, TagStyle};
use progenitor_impl::space_out_items;

Expand Down Expand Up @@ -304,7 +304,7 @@ pub fn dependencies(builder: Generator, include_client: bool) -> Vec<String> {
deps
}

fn load_api<P>(p: P) -> Result<OpenAPI>
fn load_api<P>(p: P) -> Result<Spec>
where
P: AsRef<Path> + std::clone::Clone + std::fmt::Debug,
{
Expand Down
2 changes: 1 addition & 1 deletion progenitor-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "../README.md"
heck = { workspace = true }
http = { workspace = true }
indexmap = { workspace = true }
openapiv3 = { workspace = true }
oas3 = { workspace = true }
proc-macro2 = { workspace = true }
quote = { workspace = true }
regex = { workspace = true }
Expand Down
20 changes: 10 additions & 10 deletions progenitor-impl/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::collections::BTreeMap;

use heck::ToKebabCase;
use openapiv3::OpenAPI;
use oas3::Spec;
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use typify::{Type, TypeEnumVariant, TypeSpaceImpl, TypeStructPropInfo};
Expand All @@ -24,7 +24,7 @@ struct CliOperation {

impl Generator {
/// Generate a `clap`-based CLI.
pub fn cli(&mut self, spec: &OpenAPI, crate_name: &str) -> Result<TokenStream> {
pub fn cli(&mut self, spec: &Spec, crate_name: &str) -> Result<TokenStream> {
validate_openapi(spec)?;

// Convert our components dictionary to schemars
Expand All @@ -40,15 +40,15 @@ impl Generator {
let raw_methods = spec
.paths
.iter()
.flat_map(|(path, ref_or_item)| {
// Exclude externally defined path items.
let item = ref_or_item.as_item().unwrap();
item.iter().map(move |(method, operation)| {
(path.as_str(), method, operation, &item.parameters)
})
.flat_map(|paths| paths.iter())
.flat_map(|(path, item)| {
item.methods()
.into_iter()
.map(move |(method, operation)| (path.as_str(), method, operation, item))
})
.map(|(path, method, operation, path_parameters)| {
self.process_operation(operation, &spec.components, path, method, path_parameters)
.map(|(path, method, operation, item)| {
let method_str = method.as_str().to_ascii_lowercase();
self.process_operation(operation, spec, path, &method_str, &item.parameters)
})
.collect::<Result<Vec<_>>>()?;

Expand Down
Loading