You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return type (schema) of the postTagByProject method is Branch instead of Tag. This leads to several issues in the generated files, too. See: openapi.yaml.
val projectApi =ProjectApi(defaultClient)
val commitApi =CommitApi(defaultClient)
val tagApi =TagApi(defaultClient)
//...val project = projectApi.postProject(Project().apply {
name ="demo project"
})
val commit = commitApi.postCommitByProject(project.atId, Commit(), null) // An empty commit is added
tagApi.postTagByProject(project.atId, Tag().apply {
name ="my_tag"
taggedCommit =BranchHead().atId(commit.atId)
}) // Exception: Unexpected value 'Tag'
Expected output: the posted tag is returned.
Actual output: the pilot server implementation correctly returns a Tag which results in an exception when the client deserializes the result (because a Branch is expected).
Stack trace:
Exception in thread "main" java.lang.IllegalArgumentException: Unexpected value 'Tag'
at org.omg.sysml.model.Branch$AtTypeEnum.fromValue(Branch.java:68)
at org.omg.sysml.model.Branch$AtTypeEnum$Adapter.read(Branch.java:80)
at org.omg.sysml.model.Branch$AtTypeEnum$Adapter.read(Branch.java:71)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.Gson.fromJson(Gson.java:932)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at org.omg.sysml.JSON.deserialize(JSON.java:163)
at org.omg.sysml.ApiClient.deserialize(ApiClient.java:775)
at org.omg.sysml.ApiClient.handleResponse(ApiClient.java:978)
at org.omg.sysml.ApiClient.execute(ApiClient.java:905)
at org.omg.sysml.api.TagApi.postTagByProjectWithHttpInfo(TagApi.java:590)
at org.omg.sysml.api.TagApi.postTagByProject(TagApi.java:567)
at MainKt.main(Main.kt:24)
at MainKt.main(Main.kt)
The text was updated successfully, but these errors were encountered:
The return type (schema) of the
postTagByProject
method isBranch
instead ofTag
. This leads to several issues in the generated files, too. See: openapi.yaml.SysML v2 API Java client version: 2021-09 (commit: Merge branch 'release/2021-09' on Oct 15, 2021)
Steps to reproduce:
The following simple project reproduces the problem: api-client-bug-report.zip. Essential part:
Expected output: the posted tag is returned.
Actual output: the pilot server implementation correctly returns a
Tag
which results in an exception when the client deserializes the result (because aBranch
is expected).Stack trace:
The text was updated successfully, but these errors were encountered: