Skip to content

[BUG]Swagger: repoCreateStatus returns Status instead of an Array<Status> #9433

Closed
@gerritc

Description

@gerritc
  • Gitea version: 1.10.0
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.3 LTS
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

The Swagger api method repoCreateStatus expected an Array but gitea returns Status so the client fails with an JsonSyntaxException.

Swagger client exception

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEG IN_OBJECT at line 1 column 2 path $ at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:151) at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:76) at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:125) at jetbrains.buildServer.serverSide.ServerSideEventDispatcher.superDispatch(ServerSideEventDispatcher.java:7) at jetbrains.buildServer.serverSide.ServerSideEventDispatcher$1.run(ServerSideEventDispatcher.java:1) at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAs(SecurityContextImpl.java:17) at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAsSystem(SecurityContextImpl.java:61) at jetbrains.buildServer.serverSide.ServerSideEventDispatcher.dispatch(ServerSideEventDispatcher.java:11) at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:75) at com.sun.proxy.$Proxy21.changesLoaded(Unknown Source) at jetbrains.buildServer.serverSide.impl.BuildChangesCollector.collectChangesForBuild(BuildChangesCollector.java:15) at jetbrains.buildServer.serverSide.impl.BuildStarter.startBuild(BuildStarter.java:106) at jetbrains.buildServer.serverSide.impl.BuildStarter.lambda$null$0(BuildStarter.java:65) at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:76) at jetbrains.buildServer.serverSide.impl.BuildStarter.lambda$startBuildAsync$1(BuildStarter.java:12) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ at com.google.gson.Gson.fromJson(Gson.java:899) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at io.swagger.client.JSON.deserialize(JSON.java:133) at io.swagger.client.ApiClient.deserialize(ApiClient.java:737) at io.swagger.client.ApiClient.handleResponse(ApiClient.java:940) at io.swagger.client.ApiClient.execute(ApiClient.java:867) at io.swagger.client.api.RepositoryApi.repoCreateStatusWithHttpInfo(RepositoryApi.java:2319) at io.swagger.client.api.RepositoryApi.repoCreateStatus(RepositoryApi.java:2302) at de.t2med.teamcity.gitea.BuildStatusListener.publish(BuildStatusListener.kt:60) at de.t2med.teamcity.gitea.BuildStatusListener.publish(BuildStatusListener.kt:44) at de.t2med.teamcity.gitea.BuildStatusListener.changesLoaded(BuildStatusListener.kt:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:131) ... 19 more Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.Gson.fromJson(Gson.java:887) ... 35 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions