You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix inline enum query/path params to use typed enums instead of String (#779)
* Fix git items recursionLevel parameter to use VersionControlRecursionType enum
The recursionLevel query parameter on git::items::get and git::items::list
was typed as impl Into<String>. It now uses models::VersionControlRecursionType,
a proper enum with variants None, OneLevel, OneLevelPlusNestedEmptyFolders, Full.
Changes:
- Patcher: add VersionControlRecursionType definition to git.json and replace
the inline string enum on both the paths and x-ms-paths items operations
- Codegen: generate Display impl for all enum types so they can be serialised
as URL query parameter values
- Examples: update git_items_list and git_repo_download_zip to use the new type
Closes#78
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Refactor: detect inline enum params in codegen instead of patching specs
Previously, the patcher was adding spec patches for each inline enum
query parameter (e.g. recursionLevel). This replaces that approach with
a proper code generator fix.
Changes:
- spec.rs: WebParameter::type_name() now returns TypeName::Reference(name)
for parameters with a non-empty `enum` field and an `x-ms-enum.name`,
instead of TypeName::String.
- spec.rs: new Spec::inline_parameter_enum_schemas() collects synthetic
Schema entries for all inline enum parameters across all operations so
the models codegen can generate named enum types for them.
- codegen_models.rs: all_schemas() calls inline_parameter_enum_schemas()
to include those synthetic schemas alongside definition-based schemas.
- patcher.rs: remove the now-unnecessary patch_git_items_recursion_level
patch function.
This automatically fixes all 105 inline enum query/path parameters across
all API areas (build, git, release, wit, tfvc, wiki, etc.), generating
proper typed enum types instead of impl Into<String> for each.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix import ordering in git_repo_download_zip example
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update CHANGELOG.md for inline enum parameter changes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments