Skip to content

feat: Changes from adapted codegenerator templates#1879

Merged
gtema merged 1 commit into
mainfrom
codegenerator_997486
Jul 21, 2026
Merged

feat: Changes from adapted codegenerator templates#1879
gtema merged 1 commit into
mainfrom
codegenerator_997486

Conversation

@gtema

@gtema gtema commented Jul 21, 2026

Copy link
Copy Markdown
Owner

For SDK, TUI and CLI bindings, api_ver/microversion was only populated
from request body schema's x-openstack.min-ver, causing list/get
operations to miss version info set at the operation level. Now falls
back to operation-level spec x-openstack when body has no min-ver.

For body operations, the module name suffix _ is preserved.
For operations without a body, only the version info is set without
modifying the module name.

Fix min-ver for BS attachment and resource_filters operations

For array items where DictInput.value_type is String (e.g.,
node_taints), the CLI generates JSON objects with serde_json::Value
items. The SDK expects BTreeMap<Cow<'a, str>, Cow<'a, str>> values. The
fix now checks the DictInput value type and converts JSON values to the
appropriate SDK type:

  • String/SecretString → to_string().into() produces Into<Cow<'_, str>>
  • Integer/Number/Boolean → serde_json::from_value directly
  • Complex (dict/array) → serde_json::from_value into the SDK type

This resolves the trait bound error where Vec<BTreeMap<,
serde_json::Value>> doesn't implement Into<Vec<BTreeMap<Cow<'
, str>,
Cow<'_, str>>>>.

Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/997486

Signed-off-by: Artem Goncharov artem.goncharov@gmail.com

For SDK, TUI and CLI bindings, api_ver/microversion was only populated
from request body schema's x-openstack.min-ver, causing list/get
operations to miss version info set at the operation level. Now falls
back to operation-level spec x-openstack when body has no min-ver.

For body operations, the module name suffix _<version> is preserved.
For operations without a body, only the version info is set without
modifying the module name.

Fix min-ver for BS attachment and resource_filters operations

For array items where DictInput.value_type is String (e.g.,
node_taints), the CLI generates JSON objects with serde_json::Value
items. The SDK expects BTreeMap<Cow<'a, str>, Cow<'a, str>> values. The
fix now checks the DictInput value type and converts JSON values to the
appropriate SDK type:
- String/SecretString → to_string().into() produces Into<Cow<'_, str>>
- Integer/Number/Boolean → serde_json::from_value directly
- Complex (dict/array) → serde_json::from_value into the SDK type

This resolves the trait bound error where Vec<BTreeMap<_,
serde_json::Value>> doesn't implement Into<Vec<BTreeMap<Cow<'_, str>,
Cow<'_, str>>>>.

Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/997486

Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
@gtema
gtema force-pushed the codegenerator_997486 branch from 1993cbc to 7c311f3 Compare July 21, 2026 13:08
@gtema
gtema merged commit f2716c6 into main Jul 21, 2026
19 checks passed
@gtema
gtema deleted the codegenerator_997486 branch July 21, 2026 13:25
@gtema-release-plz gtema-release-plz Bot mentioned this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant