Closed mostafa closed 1 month ago
master
Total Size Diff :chart_with_upwards_trend: +18 Bytes
I'd be happy to donate go-api-client to you, if you want. I just need to make some changes after transferring the project.
@mostafa thank you for all your great contribution! we can create an awesome list for community projects thus the project. can still belong to you and it can get exposure
@mostafa i'm adding your project link in #6297
Summary
When creating a new organization using the Go SDK that I generated from the OpenAPI spec doc, go-api-client, the
CreateOrganization
endpoint returns a201 CREATED
HTTP status code and anOrganization
instance with a populated ID field (of the new org). However, the schema doesn't exist in the content key of the response:This results in a normal
http.Response
object to be returned in Go, instead of an instance of a struct, which is unlike other endpoints that return a processed schema as an object. If thecontent
key is added to the response of 201 status codes, it'll result in the processing of theresp
(below) into a separate instance of the (generated)Organization
struct and I can access thenewOrg
like an object:newOrg.GetId()
. In the existing case, I need to unmarshal the body of the response into amap[string]any
(JSON) object to be able to access the ID field.Testing
Access the
swagger.json
endpoint and see if the 201 status of the POST request of the/api/organizations
hasresponse.content
.Note to Reviewer
go-api-client
to you, if you want. I just need to make some changes after transferring the project.Checklist
.changeset