Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method list_acl_entries is broken #96

Open
davidglvn opened this issue Sep 7, 2023 · 3 comments
Open

Method list_acl_entries is broken #96

davidglvn opened this issue Sep 7, 2023 · 3 comments

Comments

@davidglvn
Copy link

Version

4.1.1

What happened

Finally got to test the latest updates, but list_acl_entries is broken. Running identical code to example:

        try:
            # List ACL entries
            api_response = api_instance.list_acl_entries(service_id, acl_id)
            pprint(api_response)
        except fastly.ApiException as e:
            print("Exception when calling AclEntryApi->list_acl_entries: %s\n" % e)

And getting the following error:

Invalid inputs given to generate an instance of 'AclEntry'. The input data was invalid for the allOf schema 'AclEntry' in the composed schema 'AclEntryResponse'. Error=Invalid type for variable 'negated'. Required value type is int and passed type was str at ['received_data'][0]['negated']
fastly.exceptions.ApiTypeError: Invalid type for variable 'negated'. Required value type is int and passed type was str at ['received_data'][0]['negated']

The values of service_id and acl_id are valid IDs and type of str, currently using requests workaround:

    response = requests.get(
        "{}/service/{}/acl/{}/entries".format(FASTLY_API_URL, service_id, acl_id),
        headers={
            "Fastly-Key": FASTLY_API_KEY,
            "Accept": "application/json"
        },
        timeout=5)
@SteveEasley
Copy link

I can confirm this bug. The API is returning negated as a string, when the schema is saying it should be an int.

@whiteh
Copy link

whiteh commented Jan 10, 2024

I am seeing this bug in v5.0.0 as well.

@joebeard
Copy link

Present in 5.1.0. Could this be related to the fact that this package is generated from a spec file that doesn't match the API response. Looking at the documentation at https://www.fastly.com/documentation/reference/api/acls/acl-entry/ specifically the list acl entries example response:

     "negated": 0,

We see negated is returned as an int but the API itself is returning the int as a string:

    "negated": "0",

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

No branches or pull requests

4 participants