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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ updates:
ignore:
- dependency-name: "schemars"
versions: [">=0.9.0"]
- package-ecosystem: "cargo"
directory: "/progenitor-impl/tests/output"
schedule:
interval: "weekly"
ignore:
- dependency-name: "schemars"
versions: [">=0.9.0"]
10 changes: 10 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ jobs:
- name: Run tests
run: cargo test --locked --verbose

build-test-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build the generated clients
# We don't apply --locked here as there's no Cargo.lock committed for this crate
run: cargo build --manifest-path progenitor-impl/tests/output/Cargo.toml --verbose

build-no-default-features:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
15 changes: 9 additions & 6 deletions progenitor-impl/tests/output/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
[package]
name = "test-output"
version = "0.1.0"
edition = "2024"
# typify uses `gen` as a name for parameters of the `JsonSchema` impls it emits.
# `gen` is a reserved word in Rust 2024, so generated code that derives `schemars::JsonSchema`
# only parses under an earlier edition.
edition = "2021"
rust-version = "1.85"
license = "MPL-2.0"

[dependencies]
anyhow = "1.0"
base64 = "0.21"
base64 = "0.23"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4", features = ["string"] }
futures = "0.3"
httpmock = "0.7"
httpmock = "0.8"
progenitor-client = { path = "../../../progenitor-client" }
rand = { version = "0.8", features = ["serde1"] }
rand = { version = "0.10", features = ["serde"] }
regex = "1.10"
regress = "0.7"
reqwest = "0.12"
regress = "0.12"
reqwest = "0.13"
schemars = { version = "0.8", features = ["chrono", "uuid1"] }
serde = { features = ["derive"], version = "1" }
serde_json = "1"
Expand Down
20 changes: 20 additions & 0 deletions progenitor-impl/tests/output/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,23 @@ pub mod test_default_params_builder;
pub mod test_default_params_positional;
pub mod test_freeform_response;
pub mod test_renamed_parameters;

// progenitor emits `clap::value_parser!(T)` for every argument, and clap
// infers the parser from the traits the type implements. `GetThingOrThingsId`
// implements none that clap accepts, so we, as the consumer, supply the
// parser through `ValueParserFactory`, which is what the CLI generator asks a
// consumer to do.
impl ::clap::builder::ValueParserFactory for buildomat_builder::types::GetThingOrThingsId {
type Parser = ::clap::builder::MapValueParser<
::clap::builder::StringValueParser,
fn(String) -> buildomat_builder::types::GetThingOrThingsId,
>;

fn value_parser() -> Self::Parser {
::clap::builder::TypedValueParser::map(
::clap::builder::StringValueParser::new(),
buildomat_builder::types::GetThingOrThingsId::String
as fn(String) -> buildomat_builder::types::GetThingOrThingsId,
)
}
}