-
Notifications
You must be signed in to change notification settings - Fork 812
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
Go API Client: Invalid Go package name, contains hyphens #3837
Comments
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 sed -i 's/ModelModel/Model/g' embyclient/*.go |
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. |
Sorry still pending! I swear I'll get back to you!
… @Noah-Huppert <https://github.com/Noah-Huppert> ?
—
Reply to this email directly, view it on GitHub
<#3837 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZLM4FOGWOWTYSPCHF3K7TZNPWH5AVCNFSM6AAAAABHTFVH36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBRG4ZDCNBTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for the new Publish.zip and apologies for my delay. Here is the output of go run when I import the Publish.zip contents as a directory named
All the errors are bc you can't have variable that starts with a number in go |
I have adjusted the generation now. @Noah-Huppert - can you check again please? |
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 namingThe text was updated successfully, but these errors were encountered: