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

API customfields "required" field of different type when reported by fieldsets #11093

Closed
2 tasks done
0xpr03 opened this issue May 15, 2022 · 0 comments
Closed
2 tasks done
Labels
✋ bug Confirmed bug

Comments

@0xpr03
Copy link

0xpr03 commented May 15, 2022

Debug mode

Describe the bug

When performing a get on /api/v1/fieldsets/X you also get the customfields as retrieved by api/v1/fields/Y.
The "required" field is obviously from a different source/meaning, but, the type is different.
Customfields report their value as true/false while the same data structure in field sets is reported as 0/1.

Reproduction steps

  1. Request a custom field set via the api
  2. Request a custom field via the api
  3. Compare their "required" type

Expected behavior

Both systems use the same data type to indicate whether a field is required or not. This allows to simplify de-serialization and data types drastically and prevents confusion.

Screenshots

Fieldset report
image

Requesting the fields entry
image

Snipe-IT Version

5.4.3

Operating System

Debian

Web Server

Apache

PHP Version

7.4

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@snipe snipe added the ✋ bug Confirmed bug label Jun 7, 2022
snipe added a commit that referenced this issue Jun 7, 2022
…stom_fields_fieldsets

Fixed #11093 - Return true/false for custom fields/fieldsets required value in API
@snipe snipe closed this as completed in e0102dd Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✋ bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants