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

[api-codegen] Add Rust modules override support #1998

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

ereOn
Copy link

@ereOn ereOn commented Jun 7, 2022

This PR adds the ability to override the generate Rust module during generation, to favor code-reuse and segmentation.

Basically, one can now write:

lgn_api_codegen::generate!(
    Rust,
    "../../apis",
    ["space", "session", "user", "permission"],
    rust_module_mappings => [("../../apis/common.yaml", "lgn_common::api")],
)?;

To force any external references inside ../../apis/common.yaml to use the lgn_common::api crate/module prefix instead of the automatically generated one.

@ereOn ereOn merged commit 593c4ba into main Jun 7, 2022
@ereOn ereOn deleted the api-codegen-rust-modules branch June 7, 2022 20:07
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