Swagger docs for /users/tokens/ wrong #5148

Closed
opened 2025-12-29 19:24:49 +01:00 by adam · 1 comment
Owner

Originally created by @trrunde on GitHub (Aug 5, 2021).

NetBox version

v3.0-dev

Python version

3.9

Steps to Reproduce

Go to swagger on beta demo page, scroll down to /users/tokens/
use the "try it out now" swagger suggests that one of the input is named "user"
Enter user "admin" and run the query. You will then get a result saying you have to use a valid choice.

If you enter id = 1 instead of user=admin you will get the user token in return, you will also see that the correct name is "username" instead of "user".
I believe this is a swagger bug
image (6)
image (7)
image (8)

Expected Behavior

for swagger to use "username" as input instead of user

Observed Behavior

Wrong input name, leading to error.

Originally created by @trrunde on GitHub (Aug 5, 2021). ### NetBox version v3.0-dev ### Python version 3.9 ### Steps to Reproduce Go to swagger on beta demo page, scroll down to /users/tokens/ use the "try it out now" swagger suggests that one of the input is named "user" Enter user "admin" and run the query. You will then get a result saying you have to use a valid choice. If you enter id = 1 instead of user=admin you will get the user token in return, you will also see that the correct name is "username" instead of "user". I believe this is a swagger bug ![image (6)](https://user-images.githubusercontent.com/1595396/128417810-e6de733e-ccf9-4631-b70f-16a9981f0652.png) ![image (7)](https://user-images.githubusercontent.com/1595396/128417851-9dfb7c13-6943-46b6-89a1-c24f168942de.png) ![image (8)](https://user-images.githubusercontent.com/1595396/128417869-b0494fc0-eaa1-46ac-b7a6-12fccbf3f0b3.png) ### Expected Behavior for swagger to use "username" as input instead of user ### Observed Behavior Wrong input name, leading to error.
adam added the type: bugbeta labels 2025-12-29 19:24:49 +01:00
adam closed this issue 2025-12-29 19:24:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 6, 2021):

This has been addressed under #6899. The tokens endpoint now supports filtering by both user (username) and user_id (ID).

@jeremystretch commented on GitHub (Aug 6, 2021): This has been addressed under #6899. The tokens endpoint now supports filtering by both `user` (username) and `user_id` (ID).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5148