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

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

Closed
2 of 7 tasks
gerritc opened this issue Dec 19, 2019 · 0 comments · Fixed by #9434
Closed
2 of 7 tasks

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

gerritc opened this issue Dec 19, 2019 · 0 comments · Fixed by #9434
Labels

Comments

@gerritc
Copy link

gerritc commented Dec 19, 2019

  • 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

@lunny lunny added the type/bug label Dec 20, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants