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

fix(API): allow nullable value for job's due_date #534

Merged
merged 12 commits into from
Feb 5, 2024

Conversation

hahmed-dev
Copy link
Contributor

@hahmed-dev hahmed-dev commented Feb 1, 2024

Purpose:
When creating a job from CLI and not providing due_date was adding a dummy due_date, which in fact was Go Lang adding a zero value to an attribute due_date of Time type if no value is provided.
This PR updates the schema to allow nullable values against due_date for create, update requests as well as when fetching the job.

Relevant Ticket: https://phrase.atlassian.net/browse/TSI-2297

@hahmed-dev hahmed-dev self-assigned this Feb 1, 2024
@hahmed-dev hahmed-dev changed the title Tsi 2297 fix zero value for due date fix(GO): allow nullable value for job's due_date Feb 2, 2024
@hahmed-dev hahmed-dev marked this pull request as ready for review February 2, 2024 16:45
@@ -142,6 +142,7 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.7'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'io.gsonfire:gson-fire:1.8.4'
implementation 'org.openapitools:jackson-databind-nullable:0.2.1'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for adding this line was failure encountered in Java tests regarding package resolution.


// Access the values from the JSON payload
assert.Equal(t, requestBody["name"], "createjobactionb1")
assert.Equal(t, requestBody["due_date"], nil)
Copy link
Collaborator

@jablan jablan Feb 5, 2024

Choose a reason for hiding this comment

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

I presume this assertion fails when the change in /path/jobs is reverted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, let me add some screenshot to description to make it clear. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jablan when I remove nullable from create.yaml

Screenshot 2024-02-05 at 09 43 02

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks, I wasn't really doubting :)

@jablan
Copy link
Collaborator

jablan commented Feb 5, 2024

minor comment: I wouldn't title this fix(GO), rather fix(API) as it fixes the schema itself.

@hahmed-dev hahmed-dev changed the title fix(GO): allow nullable value for job's due_date fix(API): allow nullable value for job's due_date Feb 5, 2024
@hahmed-dev hahmed-dev merged commit 38b51b5 into master Feb 5, 2024
12 checks passed
@hahmed-dev hahmed-dev deleted the tsi-2297-fix-zero-value-for-due-date branch February 5, 2024 08:56
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