Skip to content

Commit.committer.date is str, not datetime #199

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

Closed
brandonchinn178 opened this issue Apr 1, 2025 · 2 comments · Fixed by #201
Closed

Commit.committer.date is str, not datetime #199

brandonchinn178 opened this issue Apr 1, 2025 · 2 comments · Fixed by #201
Labels
enhancement New feature or request Rest API schema schema related

Comments

@brandonchinn178
Copy link

If you look at the OpenAPI spec, the get-commit endpoint returns a commit object containing committer with a date field, which is a string with date-time format. But githubkit's endpoint returns a Commit object containing GitUser where date is just a str, so the user needs to parse the datetime themselves

@yanyongyu yanyongyu added schema schema related Rest API labels Apr 1, 2025
@yanyongyu
Copy link
Owner

Do you mean the /components/schemas/commit/properties/commit/properties/committer?Its type is git-user:

git-user:
  title: Git User
  description: Metaproperties for Git author/committer information.
  type: object
  properties:
    name:
      type: string
      examples:
      - '"Chris Wanstrath"'
    email:
      type: string
      examples:
      - '"chris@ozmm.org"'
    date:
      type: string
      examples:
      - '"2007-10-29T02:42:39.000-07:00"'

As the schema shows, the date field is string but not date. If you think this should be date type, you can report this to https://github.com/github/rest-api-description/ and i will make a patch to add a format: date-time to this field.

@brandonchinn178
Copy link
Author

Ah I was looking at the wrong line in the OpenAPI spec. Thanks, I filed here: github/rest-api-description#4697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Rest API schema schema related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants