diff --git a/codegenerator/openapi/glance.py b/codegenerator/openapi/glance.py index 9a6891b..a33ea7a 100644 --- a/codegenerator/openapi/glance.py +++ b/codegenerator/openapi/glance.py @@ -207,27 +207,27 @@ IMAGE_PARAMETERS = { } IMAGE_HEADERS = { - "Content-Type": { + "content-type": { "description": LiteralScalarString( "The media type descriptor of the body, namely application/octet-stream" ), "schema": {"type": "string"}, }, - "Content-Length": { + "content-length": { "description": LiteralScalarString( "The length of the body in octets (8-bit bytes)" ), "schema": {"type": "string"}, }, - "Content-Md5": { + "content-md5": { "description": "The MD5 checksum of the body", "schema": {"type": "string"}, }, - "Content-Range": { + "content-range": { "description": "The content range of image data", "schema": {"type": "string"}, }, - "OpenStack-image-store-ids": { + "openstack-image-store-ids": { "description": "list of available stores", "schema": {"type": "array", "items": {"type": "string"}}, }, @@ -374,7 +374,7 @@ class GlanceGenerator(OpenStackServerSourceBase): if ref not in [x.ref for x in operation_spec.parameters]: operation_spec.parameters.append(ParameterSchema(ref=ref)) elif operationId == "images:post": - key = "OpenStack-image-store-ids" + key = "openstack-image-store-ids" ref = f"#/components/headers/{key}" operation_spec.responses["201"].setdefault("headers", {}) operation_spec.responses["201"]["headers"].update( @@ -394,12 +394,12 @@ class GlanceGenerator(OpenStackServerSourceBase): operation_spec.parameters.append(ParameterSchema(ref=ref)) for code in ["200", "206"]: operation_spec.responses[code].setdefault("headers", {}) - for hdr in ["Content-Type", "Content-Md5", "Content-Length"]: + for hdr in ["content-type", "content-md5", "content-length"]: operation_spec.responses[code]["headers"].setdefault( hdr, {"$ref": f"#/components/headers/{hdr}"} ) operation_spec.responses["206"]["headers"].setdefault( - "Content-Range", {"$ref": "#/components/headers/Content-Range"} + "content-range", {"$ref": "#/components/headers/content-range"} ) def _get_schema_ref( diff --git a/codegenerator/templates/rust_cli/impl.rs.j2 b/codegenerator/templates/rust_cli/impl.rs.j2 index db36b66..859e702 100644 --- a/codegenerator/templates/rust_cli/impl.rs.j2 +++ b/codegenerator/templates/rust_cli/impl.rs.j2 @@ -131,7 +131,7 @@ impl {{ target_class_name }}Command { let mut find_builder = find::{{ sdk_struct_name }}::builder(); {{ macros.set_cli_path_parameters(type_manager, "find_builder", find_mode=True) }} {%- if microversion %} - find_builder.header(http::header::HeaderName::from_static("OpenStack-API-Version"), http::header::HeaderValue::from_static("{{ "volume" if service_type == "block-storage" else service_type }} {{ microversion }}")); + find_builder.header(http::header::HeaderName::from_static("openstack-api-version"), http::header::HeaderValue::from_static("{{ "volume" if service_type == "block-storage" else service_type }} {{ microversion }}")); {%- endif %} let find_ep = find_builder .build() @@ -143,7 +143,7 @@ impl {{ target_class_name }}Command { {% set builder_mutable = type_manager.is_operation_supporting_params() %} let {{ "mut" if builder_mutable }} ep_builder = {{ sdk_mod_path[-1] }}::Request::builder(); {%- if microversion %} - ep_builder.header(http::header::HeaderName::from_static("OpenStack-API-Version"), http::header::HeaderValue::from_static("{{ "volume" if service_type == "block-storage" else service_type }} {{ microversion }}")); + ep_builder.header(http::header::HeaderName::from_static("openstack-api-version"), http::header::HeaderValue::from_static("{{ "volume" if service_type == "block-storage" else service_type }} {{ microversion }}")); {%- endif %} {{ macros.set_cli_path_parameters(type_manager, "ep_builder") }} {% include 'rust_cli/set_query_parameters.j2' %}

AltStyle によって変換されたページ (->オリジナル) /