Skip to content

[BUG] #23

@dldinternet

Description

@dldinternet

Bug Description

api/openapi.json

Line 1929 in 2b8fda8

"content": {

The response schema is incorrect. The actual API returns the Collection:

https://github.com/hostinger/api/blob/2b8fda8d4dce5a9a497e6312f9d84cfce82732e8/openapi.json#L5906C30-L5906C48

Steps to Reproduce

Both the hapi vps firewall list CLI fails as well as the python SDK.

This Python hack compensates:

            # Get the raw API response to access all fields
            rresponse = self.firewall_api.get_firewall_list_v1_without_preload_content()

            _response_types_map: dict[str, str | None] = {
                # '200': "VPSGetFirewallListV1200Response",
                '200': "List[VPSV1FirewallFirewallResource]",
                '401': "InlineObject1",
                '500': "InlineObject",
            }

            from hostinger_api import rest
            response_data = rest.RESTResponse(rresponse)
            response_data.read()

            response = self._client.response_deserialize(
                response_data=response_data,
                response_types_map=_response_types_map,
            )

Expected Behavior

Expect hapi vps firewall list to work right.

Actual Behavior

↳ hapi vps firewall list
Using config file: /Users/christo/.hapi.yaml
2025/09/17 12:01:15 json: cannot unmarshal array into Go value of type struct { Data *[]client.VPSV1FirewallFirewallResource "json:"data,omitempty""; Meta *client.CommonSchemaPaginationMetaSchema "json:"meta,omitempty"" }

Screenshots

Error Messages / Stack Trace

↳ hapi vps firewall list
Using config file: /Users/christo/.hapi.yaml
2025/09/17 12:01:15 json: cannot unmarshal array into Go value of type struct { Data *[]client.VPSV1FirewallFirewallResource "json:\"data,omitempty\""; Meta *client.CommonSchemaPaginationMetaSchema "json:\"meta,omitempty\"" }

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions