Open Noah-Huppert opened 1 month ago
@softworkz
I found a few other issues with the Golang API. It seems like there were some duplicate struct names as well. Here is the openapi-generator config I used to successfully create a compilable version of the Golang API:
generatorName: go
inputSpec: # <your emby openapi.json>
outputDir: ./embyclient/
packageName: embyclient
# Required for Golang imports to work
gitHost: github.com
gitUserId: # <your git username>
gitRepoId: # <your git repo>
validateSpec: False
modelNamePrefix: Model
# Go generator
isGoSubmodule: True
withGoMod: False
structPrefix: True
enumClassPrefix: True
I then had to run this find and replace on the output files due to a bug where the openapi-generator seems to add the modelNamePrefix
twice when referring to model structs:
sed -i 's/ModelModel/Model/g' embyclient/*.go
I fixed the package name. Can you please check whether it's working now?
I fixed the package name. Can you please check whether it's working now?
Sure thing. I'll give it a test when I have a moment free.
The auto-generated Go API client has the
package embyclient-rest-go
in every source file. This is not a valid Go package name. An alternative valid package name would beembyclient_rest_go
orembyclient
if we want to follow best practices for package naming