Skip to content

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

@mantielero

Description

@mantielero
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions