wrong type for TreeNodeMultipleChoiceFilter in swagger #8462

Closed
opened 2025-12-29 20:37:04 +01:00 by adam · 8 comments
Owner

Originally created by @johanalmquist on GitHub (Aug 13, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

3.5.7

Python version

3.10

Steps to Reproduce

  1. Go to /api/schema/swagger-ui/#/tenancy/tenancy_tenants_list
  2. Enter tenant group slug

Expected Behavior

I should get all my tenatns that belongs to the group with the provide name

Observed Behavior

Got type i error in swagger:
Please correct the following validation errors and try again.
index0errorValue must be an integer

Originally created by @johanalmquist on GitHub (Aug 13, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version 3.5.7 ### Python version 3.10 ### Steps to Reproduce 1. Go to /api/schema/swagger-ui/#/tenancy/tenancy_tenants_list 2. Enter tenant group slug ### Expected Behavior I should get all my tenatns that belongs to the group with the provide name ### Observed Behavior Got type i error in swagger: Please correct the following validation errors and try again. index0errorValue must be an integer
adam added the type: bugstatus: acceptedseverity: lowtopic: OpenAPI labels 2025-12-29 20:37:04 +01:00
adam closed this issue 2025-12-29 20:37:04 +01:00
Author
Owner

@abhi1693 commented on GitHub (Aug 14, 2023):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@abhi1693 commented on GitHub (Aug 14, 2023): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@johanalmquist commented on GitHub (Aug 15, 2023):

Hi,
My first bug report ever :) but i added some more infomation now

Steps to Reproduce

  • create a new Tenant Group eg Name: My group Slug: my-group
  • Create a new Tenant and add it to tenant My group
  • Navigate to the swagger rest api documentation (http:///api/schema/swagger-ui/)
  • Go down to the tenancy tab (http:///api/schema/swagger-ui/#/tenancy)
  • Select the route for tenancy_tenants (http:///api/schema/swagger-ui/#/tenancy/tenancy_tenants_list)
  • Press the "Try it out" button
  • For the group query params enter the slug for the tenant group (my-group)

Expected Behavior
I should get all tenants that belongs to the tenant group My group. This works fine when you using api without the go via the swagger.
The url i then: http:///api/tenancy/tenants/?group=my-group

Observed Behavior
Got type i error in swagger:
Please correct the following validation errors and try again.
index0errorValue must be an integer

Se image
Skärmavbild 2023-08-15 kl  18 46 07
Skärmavbild 2023-08-15 kl  18 46 30

@johanalmquist commented on GitHub (Aug 15, 2023): Hi, My first bug report ever :) but i added some more infomation now **Steps to Reproduce** - create a new Tenant Group eg Name: My group Slug: my-group - Create a new Tenant and add it to tenant My group - Navigate to the swagger rest api documentation (http://<netbox-host>/api/schema/swagger-ui/) - Go down to the tenancy tab (http://<netbox-host>/api/schema/swagger-ui/#/tenancy) - Select the route for tenancy_tenants (http://<netbox-host>/api/schema/swagger-ui/#/tenancy/tenancy_tenants_list) - Press the "Try it out" button - For the group query params enter the slug for the tenant group (my-group) **Expected Behavior** I should get all tenants that belongs to the tenant group My group. This works fine when you using api without the go via the swagger. The url i then: http://<netbox-host>/api/tenancy/tenants/?group=my-group **Observed Behavior** Got type i error in swagger: Please correct the following validation errors and try again. index0errorValue must be an integer Se image <img width="1104" alt="Skärmavbild 2023-08-15 kl 18 46 07" src="https://github.com/netbox-community/netbox/assets/16856344/b2e7f9bd-9e0c-4f40-88f2-c7b53cf4af14"> <img width="1104" alt="Skärmavbild 2023-08-15 kl 18 46 30" src="https://github.com/netbox-community/netbox/assets/16856344/21a6a6fb-df96-422e-a627-85a58a2925e6">
Author
Owner

@kkthxbye-code commented on GitHub (Aug 17, 2023):

Replicates fine. Seems to be an issue with TreeNodeMultipleChoiceFilter not mapping to the correct type in the schema. Not sure how issues like these are fixed when the type depends on the to_field_name parameter. Doesn't seem to be an issue for django_filters.ModelMultipleChoiceFilter.

@kkthxbye-code commented on GitHub (Aug 17, 2023): Replicates fine. Seems to be an issue with TreeNodeMultipleChoiceFilter not mapping to the correct type in the schema. Not sure how issues like these are fixed when the type depends on the `to_field_name` parameter. Doesn't seem to be an issue for `django_filters.ModelMultipleChoiceFilter`.
Author
Owner

@aopdal commented on GitHub (Aug 28, 2023):

Does this bug track all string - integer errors in swagger?

@aopdal commented on GitHub (Aug 28, 2023): Does this bug track all string - integer errors in swagger?
Author
Owner

@kkthxbye-code commented on GitHub (Aug 28, 2023):

Does this bug track all string - integer errors in swagger?

All that are caused by TreeNodeMultipleChoiceFilter resolving to the wrong type.

@kkthxbye-code commented on GitHub (Aug 28, 2023): > Does this bug track all string - integer errors in swagger? All that are caused by `TreeNodeMultipleChoiceFilter` resolving to the wrong type.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 28, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 28, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Dec 29, 2023):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Dec 29, 2023): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Author
Owner

@TorstenEhrhardt commented on GitHub (Jul 12, 2024):

I have a solution for this to get the type inside the TreeNodeMultipleChoiceFilter class
I already did a commit in my fork

@TorstenEhrhardt commented on GitHub (Jul 12, 2024): I have a solution for this to get the type inside the TreeNodeMultipleChoiceFilter class I already did a commit in my fork
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8462