Skip to content

[BUG][Go] go-echo-server generator does not respect the --git-host argument #15636

@osechet

Description

@osechet

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The go-echo-server generator does not respect the --git-host argument. The generated code always defines the module's name as "github.com/user/repo".

openapi-generator version

6.6.0
7.0.0-20230525.031952-54 (latest nightly)

OpenAPI declaration file content or url

The problem is not related to the input file. It can be reproduced with the petstore example: https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml

Generation Details
openapi-generator-cli generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml --git-host gitlab.com --git-user-id myuser --git-repo-id myrepo -g go-echo-server --additional-properties packageName=myproject -o myproject
Steps to reproduce
  • Call the command given in previous section
  • Open go.mod or any file in the handlers directory
  • The module is github.com/myuser/myrepo instead of gitlab.com/myuser/myrepo.
Related issues/PRs

N/A

Suggest a fix

Replacing github.com/{{{gitUserId}}}/{{{gitRepoId}}} by {{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}} in all the files of modules\openapi-generator\src\main\resources\go-echo-server should probably fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions