Skip to content
Merged
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
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Changelog

## Unreleased
## 0.17.5

Python client generation improvements:

- Python codegen still falls back to basic formatting when Ruff is not installed, but now reports an error if `ruff format` is available and fails; pass `--format=false` to skip external formatting.
- Python codegen still falls back to basic formatting when Ruff is not installed, but now reports a clear error — including the formatter's own exit status and output — if `ruff format` is available and fails; pass `--format=false` to skip external formatting.
- Multi-field Rust tuple structs now generate valid Python `RootModel[tuple[...]]` models instead of invalid numeric field names.
- Generated Python clients with nested namespaces now import cleanly when models refer to parent or sibling namespaces, including cases like `offer_rules.InsurerCategory`.
- Namespace names containing characters that are not valid in Python identifiers, such as dashes or leading digits, now generate valid Python classes.
- A root type and a same-leaf type under a sub-namespace (e.g. `IfConflictOnUpdate` and `nomatches::IfConflictOnUpdate`) no longer collide on a bare public name. Previously each namespace re-emitted a `<Leaf> = <NamespacePrefixedLeaf>` alias that shadowed the `from .._types import <Leaf>` it also imported, so `_types.<Leaf>` and `<ns>.<Leaf>` resolved to two different classes and field annotations silently bound to the wrong one (pydantic then rejected values with a confusingly self-identical error). The namespace-local type now keeps its disambiguated name (`NomatchesIfConflictOnUpdate`) and references resolve to a single class per logical type.
- Fixed generated clients silently using the wrong class when a sub-namespace defined a type whose name matched a top-level type (e.g. a top-level `IfConflictOnUpdate` and a `nomatches::IfConflictOnUpdate`). The two were emitted as separate classes sharing one name, so a value built with one was rejected by the other at runtime with a confusingly self-identical pydantic validation error. Each logical type now resolves to a single class: when names would clash, the sub-namespace type is exposed under a namespace-qualified name (e.g. `nomatches.NomatchesIfConflictOnUpdate`) while the short name (`nomatches.IfConflictOnUpdate`) refers to the top-level type.
- Schemas with a root namespace named `sys` no longer conflict with Python's standard `sys` module.
- Re-running `reflectapi codegen` into an existing output directory now removes generated files from older schemas while preserving hand-written files.

Expand Down
8 changes: 4 additions & 4 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 reflectapi-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reflectapi-cli"
version = "0.17.4"
version = "0.17.5"
edition = "2021"
default-run = "reflectapi"

Expand All @@ -23,7 +23,7 @@ doc = false
workspace = true

[dependencies]
reflectapi = { path = "../reflectapi", version = "0.17.4", features = ["codegen"] }
reflectapi = { path = "../reflectapi", version = "0.17.5", features = ["codegen"] }
rouille = "3"

clap = { version = "4.5.3", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions reflectapi-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reflectapi-derive"
version = "0.17.4"
version = "0.17.5"
edition = "2021"

license = "Apache-2.0"
Expand All @@ -22,7 +22,7 @@ workspace = true
proc-macro = true

[dependencies]
reflectapi-schema = { path = '../reflectapi-schema', version = "0.17.4" }
reflectapi-schema = { path = '../reflectapi-schema', version = "0.17.5" }

proc-macro2 = "1.0"
quote = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion reflectapi-python-runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "reflectapi-runtime"
version = "0.17.4"
version = "0.17.5"
description = "Runtime library for ReflectAPI Python clients"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
)
from .types import BatchResult, ReflectapiEmpty, ReflectapiInfallible

__version__ = "0.17.4"
__version__ = "0.17.5"

__all__ = [
# Authentication
Expand Down
2 changes: 1 addition & 1 deletion reflectapi-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reflectapi-schema"
version = "0.17.4"
version = "0.17.5"
edition = "2021"

license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions reflectapi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reflectapi"
version = "0.17.4"
version = "0.17.5"
edition = "2021"

license = "Apache-2.0"
Expand All @@ -20,8 +20,8 @@ workspace = true

[dependencies]
# workspace dependencies
reflectapi-derive = { path = "../reflectapi-derive", version = "0.17.4" }
reflectapi-schema = { path = "../reflectapi-schema", version = "0.17.4" }
reflectapi-derive = { path = "../reflectapi-derive", version = "0.17.5" }
reflectapi-schema = { path = "../reflectapi-schema", version = "0.17.5" }

# mandatory 3rd party dependencies
serde = { version = "1.0.197", features = ["derive"] }
Expand Down
Loading