Skip to content
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

Types can be placed separately from the server side logic #389

Closed
wants to merge 1 commit into from

Conversation

sparshev
Copy link
Contributor

Additional option to specify which module contains the generated types

@sparshev
Copy link
Contributor Author

Hi @deepmap-marcinr, could you please suggest who can check the PR? If it's good - I can work on the tests and other required improvements to make sure it will fit perfectly.

@sparshev
Copy link
Contributor Author

Hi @deepmap-marcinr could you please check this? Not sure if it's still actual though...

@tuxofil
Copy link

tuxofil commented Apr 24, 2022

Rebased and adapted this patch in #558 . I think we can close it now.

@sparshev
Copy link
Contributor Author

sparshev commented Apr 24, 2022

Thank you @tuxofil , I've got no review, so I switched to in-place patching and almost forgot about this change - for sure when yours will be merged I will close this one.

@sparshev
Copy link
Contributor Author

Ok, now types could be separated the next way:

  • For types package:
    ---
    package: types
    output: types/types.gen.go
    generate:
      models: true
  • For the server package:
    ---
    package: api
    output: api/server_v1.gen.go
    generate:
      echo-server: true
    additional-imports:
      - alias: .  # means will be used without namespace prefix
        package: github.com/exampleorg/exampleproj/pkg/types  # full path to the types package

So the types will be available to use in server generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants