Skip to content

[cpprest] Dots and dashes are allowed in C++ identifiers. #8460

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

Open
Jauler opened this issue Jul 20, 2018 · 0 comments · May be fixed by #9427
Open

[cpprest] Dots and dashes are allowed in C++ identifiers. #8460

Jauler opened this issue Jul 20, 2018 · 0 comments · May be fixed by #9427

Comments

@Jauler
Copy link

Jauler commented Jul 20, 2018

Description

When generating cpprest dots and dashes are allowed for C++ identifier names which causes uncompilable code like:

class  Io.k8s.kubernetes.pkg.api.v1.Service
    : public ModelBase
{
...
Swagger-codegen version

2.4.0-SNAPSHOT from docker hub: https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/

Swagger declaration file content or url

https://raw.githubusercontent.com/kubernetes/kubernetes/v1.10.4/api/openapi-spec/swagger.json

Command line used for generation
docker run swaggerapi/swagger-codegen-cli generate  --lang cpprest --output /output -i https://raw.githubusercontent.com/kubernetes/kubernetes/v1.10.4/api/openapi-spec/swagger.json
Steps to reproduce

run:

docker run swaggerapi/swagger-codegen-cli generate  --lang cpprest --output /output -i https://raw.githubusercontent.com/kubernetes/kubernetes/v1.10.4/api/openapi-spec/swagger.json

After generating any class in model directory will have such invalid names.

Suggest a fix/enhancement

Maybe map dots to "_", but care must be taken to avoid name clashes.

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 a pull request may close this issue.

1 participant