Skip to content

Generated schema files can include C++ reserved keywords #209

Closed
@AndrewLipscomb

Description

@AndrewLipscomb

For a schema file

input DocumentFields {
    display: String
    default: Boolean
}

You end up with the generated member for DocumentFields

	std::optional<bool> default {};

Which is a no-go due to the default keyword.

While in our case we have the opportunity to change this schema - obviously thats not available to everyone.

I've seen other libs work around the keywords issue by renaming keys to be default_ or similar - boost::hana does this for default_ and case_

I've only dug into the library just now so unsure how the generator works under the hood - this might be a hard one to work around in the generator code.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions