Bug Report Checklist
Description
[Nim] Generated code does not compile if one schema constains a keyword 'enum' and one of the enum values is not a valid Nim identifier.
Identifier validity of Nim is not respected, code can not compile.
openapi-generator version
7.11, master.
OpenAPI declaration file content or url
{
"openapi": "3.0.0",
"info": {
"title" : "mre",
"version": "1.0.0"
},
"servers": [{
"url": "/"
}],
"paths": {
"/foo": {
"description" : "foopath",
"get": {
"operationId" : "GetFoo",
"description" : "get operation",
"parameters": [
{
"name": "param1",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description" : "someresponse",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"the_resp" : {
"type" : "string",
"enum" : ["a!a", "b?b", "c%c"]
}
}
}
}
}
}
}
}
}
}
}
Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g nim -i ~/mre.json -o ~/mre_client
Steps to reproduce
cd ~/mre_client
nim compile sample_client.nim
Related issues/PRs
None
Suggest a fix
Bug Report Checklist
Description
[Nim] Generated code does not compile if one schema constains a keyword 'enum' and one of the enum values is not a valid Nim identifier.
Identifier validity of Nim is not respected, code can not compile.
openapi-generator version
7.11, master.
OpenAPI declaration file content or url
{ "openapi": "3.0.0", "info": { "title" : "mre", "version": "1.0.0" }, "servers": [{ "url": "/" }], "paths": { "/foo": { "description" : "foopath", "get": { "operationId" : "GetFoo", "description" : "get operation", "parameters": [ { "name": "param1", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description" : "someresponse", "content": { "application/json": { "schema": { "type": "object", "properties": { "the_resp" : { "type" : "string", "enum" : ["a!a", "b?b", "c%c"] } } } } } } } } } } }Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g nim -i ~/mre.json -o ~/mre_client
Steps to reproduce
cd ~/mre_client
nim compile sample_client.nim
Related issues/PRs
None
Suggest a fix