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

Allow API endpoints to determine default boolean option values #12

Merged

Conversation

chrisnovakovic
Copy link
Collaborator

@chrisnovakovic chrisnovakovic commented Feb 23, 2024

On Jira API endpoints that accept boolean parameters, the value of the parameter may default to either true or false if it isn't supplied in the request, depending on the endpoint. In options structs that have them, change the type of fields representing these parameters from bool to *bool, so that their value isn't explicitly set to false in the request if a value isn't given in the struct - in order words, let the API endpoint decide what the value should be, not go-jira.

Copy link

@RichardoC RichardoC left a comment

Choose a reason for hiding this comment

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

This is a much nicer solution. Should we do this for the other boolean options?

On Jira API endpoints that accept boolean parameters, the value of the
parameter may default to either true or false if it isn't supplied in
the request, depending on the endpoint. In options structs that have
them, change the type of fields representing these parameters from
`bool` to `*bool`, so that their value isn't explicitly set to false in
the request if a value isn't given in the struct - in order words, let
the API endpoint decide what the value should be, not go-jira.
@chrisnovakovic chrisnovakovic force-pushed the tristate-bool-notifyusers branch from ab54a10 to 7ffee35 Compare February 23, 2024 12:25
@chrisnovakovic
Copy link
Collaborator Author

Good idea - I've widened this to cover all bools in options structs, not just notifyUsers. I can't see a compelling reason not to.

@chrisnovakovic chrisnovakovic changed the title Allow API endpoints to determine default notifyUsers option value Allow API endpoints to determine default boolean option values Feb 23, 2024
@chrisnovakovic chrisnovakovic merged commit 3870a80 into thought-machine:v1 Feb 23, 2024
6 checks passed
@chrisnovakovic chrisnovakovic deleted the tristate-bool-notifyusers branch February 23, 2024 12:28
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.

2 participants