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

Return flat JSON instead of transformed data #16249

Merged
merged 1 commit into from
Feb 13, 2025
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Feb 13, 2025

In a previous PR, we updated the update() method of the API assets controller to use the standard asset payload return. This unfortunately broke some integrations with Kandji2Snipe and Jamf2Snipe, as those are expecting the old (incorrect) flat object shape.

This is a temporary fix, as I think the API object return shape should conform with the way we return it everywhere else, but this should at least get people who use Kandji2Snipe and Jamf2Snipe back up and running.

Big thanks to @uberbrady, @ctsamuraix, @ParadoxGuitarist, and @mcarras8 for working through the issue with us.

The longer term plan will be to correct those scripts to use the "right" API object return shape, and/or allow you to opt into using the new one if for some reason you can't update your own integrations.

This should fix grokability/jamf2snipe#134

Copy link

what-the-diff bot commented Feb 13, 2025

PR Summary

  • Refined Return/response in 'AssetsController.php'
    Updated the 'AssetsController.php' to provide a more raw and direct result when calling the 'update' function. This improves consistency across both successful and warning messages.
  • Enhanced In-code Documentation
    Additional comments have been added to outline the rationale behind the changes, and proper instructions indicating what the return type should normally be. This ensures that the changes can be easily understood by other developers working on the project in the future.

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it sucks to have to revert the more 'correct' version here, but I agree with you that it's the right move for right now. We'll get back to looking at this properly soon.

@snipe snipe merged commit 393118f into develop Feb 13, 2025
9 checks passed
@snipe snipe deleted the flatten_api_return branch February 13, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants