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

[BUG] Nim - properties named: A.b #9250

Closed
mantielero opened this issue Apr 13, 2021 · 4 comments · Fixed by #9255
Closed

[BUG] Nim - properties named: A.b #9250

mantielero opened this issue Apr 13, 2021 · 4 comments · Fixed by #9255

Comments

@mantielero
Copy link

Description

I am using the generator exporting to nim. I am facing a YAML file which contains under components the following:

    CsvZipSample:
      type: "object"
      description: "A zip csv sample"
      properties:
        Data.zip:
          type: "number"

This creates the following model file:

import json
import tables


type CsvZipSample* = object
  ## A zip csv sample
  Data.zip*: float

Where Data.zip: is not valid Nim code.

openapi-generator version

openapi-generator-cli-5.2.0-20210401.015808-6.jar

OpenAPI declaration file content or url

I cannot share the file/url.

Generation Details
java -jar openapi-generator-cli-5.2.0-20210401.015808-6.jar generate  -g nim -i <url> -o myclient
Steps to reproduce
java -jar openapi-generator-cli-5.2.0-20210401.015808-6.jar generate  -g nim -i <url> -o myclient

The execution of the sample fails:

c:> nim c sample_client
...
model_csv_zip_sample.nim(16, 7) Error: ':' or '=' expected, but got '.'
Related issues/PRs

N/A

Suggest a fix

Maybe to export the property as: dataZip.

@wing328
Copy link
Member

wing328 commented Apr 13, 2021

@mantielero thanks for reporting the issue. I've filed #9255 to fix the issue.

@wing328
Copy link
Member

wing328 commented Apr 14, 2021

@mantielero issue fixed. Please give it a try with the latest master or snapshot version (you can find the URL in the readme)

@mantielero
Copy link
Author

Is there a openapi-generator-cli.jar with master/snapshot avaliable somewhere? I am not free to build in this computer.

@wing328
Copy link
Member

wing328 commented Apr 17, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants