Skip to content
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

Fixed body parameter in github models #175

Merged
merged 2 commits into from
Jun 11, 2021
Merged

Conversation

tegorov
Copy link
Contributor

@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
Member

gianluz commented Jun 10, 2021

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

Copy link
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
Contributor 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.

None yet

3 participants