Skip to content

[Api Generator] Add mechanism to escape C# keywords for path parts #5563

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

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

stevejgordon
Copy link
Contributor

Some recent additions to the API spec (for example security.clear_cached_service_tokens.json), include a path part named namespace. Since this is a C# keyword, the generated code does not compile. This change addresses this and provides a mechanism for this and future replacements via an extension method. This method adjusts the name if it matches any reserved keywords defined in the dictionary. The variable name and the URL code call this extension to adjust accordingly.

@stevejgordon stevejgordon changed the title Add mechanism to escape C# keywords for path parts [Api Generator] Add mechanism to escape C# keywords for path parts Apr 21, 2021
@stevejgordon stevejgordon merged commit 26f78c2 into 7.x Apr 21, 2021
@stevejgordon stevejgordon deleted the infra/code-gen-keyword-fix branch April 21, 2021 09:36
stevejgordon added a commit that referenced this pull request Apr 21, 2021
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
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.

1 participant