Skip to content

Broken decoding of Issue without a body (when its a PR) #233

Open

Description

@YarekTyshchenko

Issues endpoints also return PRs. Body in a PR is Option, but isn't in Issue. This breaks at runtime during deserialisation.

github4s.GithubResponses$JsonParsingException: String: DownField(body)

Activity

  1. fedefernandez commented on Dec 12, 2018

    @fedefernandez
    Contributor

    Good catch @YarekTyshchenko, we have two different operations for Issues and PRs. I'm wondering what will be the right behavior here. I guess the easy one is just to make optional the body in the Issue model.

  2. YarekTyshchenko commented on Dec 12, 2018

    @YarekTyshchenko
    ContributorAuthor

    Could filter out PRs from the issue endpoint, but it would cause unnecessary traffic. I'd be happy with an Optional body for now, since even in the docs they tell you to filter them yourself based on the presence of the pr urls field

  3. juanpedromoreno commented on Dec 27, 2018

    @juanpedromoreno
    Member

    It seems like #236 has introduced a random test failure, which I've ignored here: 24dd556, as part of #243.

    We might want to re-visit this issue later on.

  4. JesusMtnez commented on Jan 4, 2019

    @JesusMtnez
    Contributor

    I've done some debugging.

    That test is failing because issue #1 has a body, and the test expects an empty body.

    But if we use other issue with an empty body (that is a PR), like #154 , instead of receiving and empty body decoded to None, circe is decoding it to Some() 😵

    More debugging is needed to know why that is happening 🤔

  5. YarekTyshchenko commented on Jan 4, 2019

    @YarekTyshchenko
    ContributorAuthor

    I've seen this before, Some PRs have empty body (from json response ""), some actual null. I can't see any regularity, but i know that once the PR is edited it will never have a null body. I can only replicate this with a private repo atm

  6. YarekTyshchenko commented on Jan 4, 2019

    @YarekTyshchenko
    ContributorAuthor

    I create my PRs with hub utility. It could be a factor

  7. JesusMtnez commented on Jan 4, 2019

    @JesusMtnez
    Contributor

    🤔 Issues is implemented using circe generic auto, maybe we could implement the decoders/encoders making them handle those cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions