Skip to content

[BUG]: subject_type param not respected when creating a comment on a pull request #1748

@kartikjain26

Description

@kartikjain26

What happened?

Use case: I want to post a comment on the file level of a pull request using path of the file.

I used subject_type: 'file' param while creating a comment on a pull request as mentioned here: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request
https://docs.github.com/en/[email protected]/rest/pulls/comments#create-a-review-comment-for-a-pull-request

Sample payload:

Image

Response code: 422
Error:

{
  "message": "Invalid request.\n\nNo subschema in \"oneOf\" matched.\n\"position\" wasn't supplied.\n\"in_reply_to\" wasn't supplied.\n\"subject_type\" is not a permitted key.\n\"line\" wasn't supplied.",
  "documentation_url": "https://docs.github.com/enterprise/3.6/rest"
}

Versions

[email protected]

Relevant log output

{
  "message": "Invalid request.\n\nNo subschema in \"oneOf\" matched.\n\"position\" wasn't supplied.\n\"in_reply_to\" wasn't supplied.\n\"subject_type\" is not a permitted key.\n\"line\" wasn't supplied.",
  "documentation_url": "https://docs.github.com/enterprise/3.6/rest"
}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🔥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions