Skip to content

Fix api_filter to allow UUIDs#159

Merged
FragmentedPacket merged 1 commit intonautobot:developfrom
lungj:develop
Aug 24, 2022
Merged

Fix api_filter to allow UUIDs#159
FragmentedPacket merged 1 commit intonautobot:developfrom
lungj:develop

Conversation

@lungj
Copy link
Copy Markdown
Contributor

@lungj lungj commented Aug 21, 2022

In the existing code, trying to filter by id leads to the id being turned into an int. However, UUIDs are actually non-integer strings, so, if anything, we should be checking that the value is a UUID.

However, I simply removed the checking entirely to preserve the behaviour of the example lookup with id=1 from the forked Netbox code.

As a result of the change, the original behaviour should be preserved as well as supporting this type of use:

{{ query('networktocode.nautobot.lookup', 'devices', api_filter='id=an_actual_uuid', api_endpoint=nautobot_endpoint, token=nautobot_token) }}

@FragmentedPacket FragmentedPacket merged commit e794da3 into nautobot:develop Aug 24, 2022
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.

3 participants