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

Name aliases in configuration #41

Open
Chlumsky opened this issue Mar 26, 2023 · 1 comment
Open

Name aliases in configuration #41

Chlumsky opened this issue Mar 26, 2023 · 1 comment
Labels
code-generation Involves generation of parser / serializer code enhancement Enhancement of existing feature

Comments

@Chlumsky
Copy link
Owner

Since #1 will not be implemented for a while, there needs to be another way to resolve cases where JSON field names (or even enumeration values) are not valid C++ names, e.g. protected (reserved keyword) or value-with-dashes, or when the user wants the JSON names to be different for whatever reason.

@Chlumsky Chlumsky added enhancement Enhancement of existing feature code-generation Involves generation of parser / serializer code labels Mar 26, 2023
@Chlumsky
Copy link
Owner Author

It should be possible to provide both a simple dictionary applied to all enum values and member variable names, as well as qualified names for specific enums / structures only, e.g.:

"nameAliases": {
    "ENUM_VAL": "enum-val-as-it-appears-in-json",
    "SpecificEnum::ENUM_VAL": "enum-val-of-SpecificEnum",
    "MyStructure::bProtected": "protected"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation Involves generation of parser / serializer code enhancement Enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

1 participant