Milestone Creation: make "due date" optional #240

Closed
opened 2020-06-03 23:47:21 +00:00 by 6543 · 7 comments
Member
No description provided.
6543 added this to the 2.4.0 milestone 2020-06-03 23:47:21 +00:00
6543 added the
🚀 Improvement
label 2020-06-03 23:47:21 +00:00
6543 closed this issue 2020-06-03 23:47:21 +00:00
Author
Member

note: creat issue via gitnex auto assign you too

note: creat issue via gitnex auto assign you too
Owner

The last time I checked these both were required by the API. Cant say about 1.9 or 1.10 now.

Is both optional now by the API?

The last time I checked these both were required by the API. Cant say about 1.9 or 1.10 now. Is both optional now by the API?
Author
Member

Its not in 1.10.1 (tested)

POST /repos/{owner}/{repo}/milestones?token=...

body:

{
  "title": "stone2"
}

works fine

but

{
  "title": "stone3",
  "due_on": ""
}

does not!

Its not in 1.10.1 (tested) `POST /repos/{owner}/{repo}/milestones?token=...` body: ```json { "title": "stone2" } ``` works fine but ```json { "title": "stone3", "due_on": "" } ``` does not!
Owner

If it works with 1.9 too, then we can make it optional. Otherwise a logic/fallback will be needed for 1.9.

If it works with 1.9 too, then we can make it optional. Otherwise a logic/fallback will be needed for 1.9.
Author
Member

@mmarif gitea API makes a different if a parameter is in json with value: "" or not!!

@mmarif gitea API makes a different if a parameter is in json with value: "" or not!!
Owner

Is that considered a bug in gitea api?

Is that considered a bug in gitea api?
Author
Member

this has to do with json -> go struct convertion ...

I could not find a easy way to fix this now (I have to change the type to string and parse time myself usw ...)

an easy workaround for GitNex (backwards compatible) exist:

if we like to have NO due_date set UnixTime: 253402297199

wich is in go: time.ParseInLocation("2006-01-02", "9999-12-31", time.Local)

this has to do with json -> go struct convertion ... I could not find a easy way to fix this now (I have to change the type to string and parse time myself usw ...) an easy workaround for GitNex (backwards compatible) exist: if we like to have NO due_date set UnixTime: `253402297199` wich is in go: `time.ParseInLocation("2006-01-02", "9999-12-31", time.Local)`
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#240
No description provided.