Skip to content

Conversation

@neilmartin83
Copy link
Contributor

Change

Thank you for your contribution !
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.

Reviewed the endpoint and refactored fields to remove excessive pointer usage. Should make it more robust and efficient. Have also ensured optional fields as specified in the API schema are omitted. https://developer.jamf.com/jamf-pro/reference/post_v3-mobile-device-prestages

Added a new field for installAppsDuringEnrollment.

No changes to methods - only updated types and example scripts as needed.

This will require the provider resource to be refactored to remove pointer handling for fields that no longer require it. Will submit a PR for this shortly.

The main advantage here is future proofing for new fields that appear in skipSetupItems - found that in testing, the API handles any field name supplied here safely. If you try to set one in a request body that doesn't exist in that version of JPro, it's ignored for POST/PUT. This would cause issues previously when using bool pointers.

The API is also tolerant when sending top-level fields introduced in new versions of Jamf Pro well - like installAppsDuringEnrollment, the request succeeds and the field is ignored.

I have tested against Jamf Pro 11.20 and 11.22 with no issues.

Type of Change

Please DELETE options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (Wiki)
  • Refactor (refactoring code, removing code, changing code structure)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

… add omitempty for all optional fields per API spec
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.

1 participant