Skip to content

Re-export replaced types#1007

Open
inickles wants to merge 1 commit intomainfrom
inickles/export
Open

Re-export replaced types#1007
inickles wants to merge 1 commit intomainfrom
inickles/export

Conversation

@inickles
Copy link
Copy Markdown

This re-exports types that have been replaced, making them directly available in the generated types. This can be useful when types are replaced from external packages, making such that users won't need to import the external package just to use the generated output.

Note that this will only emit types that are actually used in the schema.

pub r: NumberValue,
}
#[allow(unused_imports)]
pub use ColorValue;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this example reveals a flaw in this design:

import_types!(
    schema = "../example.json",
    replace = {
        Bar => Bar,
    }
);

struct Bar { ... }

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