Skip to content

Fixed body parameter in github models#175

Merged
f-meloni merged 2 commits into
danger:masterfrom
tegorov:master
Jun 11, 2021
Merged

Fixed body parameter in github models#175
f-meloni merged 2 commits into
danger:masterfrom
tegorov:master

Conversation

@tegorov
Copy link
Copy Markdown

@tegorov tegorov commented Jun 10, 2021

I'm getting this error when trying to run Danger from CI (Github Actions):

kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 4707: Expected string or non-null literal
JSON input: .....h"
        },
        "body": null,
        "closed_by": nul.....
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
	at kotlinx.serialization.json.internal.JsonReader.fail(JsonReader.kt:333)
	at kotlinx.serialization.json.internal.JsonReader.takeString(JsonReader.kt:147)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeString(StreamingJsonDecoder.kt:210)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeStringElement(AbstractDecoder.kt:56)
	at systems.danger.kotlin.models.github.GitHubIssue$$serializer.deserialize(GitHub.kt:242)
	at systems.danger.kotlin.models.github.GitHubIssue$$serializer.deserialize(GitHub.kt:242)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
	at systems.danger.kotlin.models.github.GitHub$$serializer.deserialize(GitHub.kt:13)
	at systems.danger.kotlin.models.github.GitHub$$serializer.deserialize(GitHub.kt:13)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:72)
	at systems.danger.kotlin.models.danger.DangerDSL$$serializer.deserialize(DangerDSL.kt:14)
	at systems.danger.kotlin.models.danger.DangerDSL$$serializer.deserialize(DangerDSL.kt:14)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
	at systems.danger.kotlin.models.danger.DSL$$serializer.deserialize(DangerDSL.kt:9)
	at systems.danger.kotlin.models.danger.DSL$$serializer.deserialize(DangerDSL.kt:9)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:85)
	at systems.danger.kotlin.MainDangerRunner.<init>(MainDangerRunner.kt:124)
	at systems.danger.kotlin.MainScriptKt.Danger(MainScript.kt:44)
	at Dangerfile_df.<init>(Dangerfile.df.kts:39)

If a pull request is created through github api without body parameter, then body parameter will be null
For verification, I created pull request through github api: tegorov#1

@gianluz
Copy link
Copy Markdown
Member

gianluz commented Jun 10, 2021

Thanks for the pull request!! could you please update the CHANGELOG.md with your PR?

Copy link
Copy Markdown
Member

@f-meloni f-meloni left a comment

Choose a reason for hiding this comment

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

After the CHANGELOG is updated for me is ready to go :)

Thank you!

@tegorov
Copy link
Copy Markdown
Author

tegorov commented Jun 11, 2021

Thanks! I updated the changelog

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.

3 participants