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 generate models with numbers #262

Open
kaiserdj opened this issue May 17, 2021 · 2 comments
Open

Bug generate models with numbers #262

kaiserdj opened this issue May 17, 2021 · 2 comments

Comments

@kaiserdj
Copy link

Hi,

When generating an api in which an object has an element with a number at the beginning, it is generated wrong
Example:

"Account": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "integer"
        },
        "profile": {
          "$ref": "#/definitions/UserProfile"
        },
        "email_confirmed": {
          "type": "boolean"
        },
        "2fa_enabled": {
          "type": "boolean",
          "description": "Indicates that Two Factor Authentication (2FA) is enabled for this account"
        },
      }
    },

Results:

/* tslint:disable */
import { UserProfile } from './user-profile';
export interface Account {

  /**
   * Indicates that Two Factor Authentication (2FA) is enabled for this account
   */
  2fa_enabled?: boolean;
  profile?: UserProfile;
  user_id?: number;
}

Surrounding 2fa_enabled with double quotes solves the problem:
2fa_enabled -> "2fa_enabled"

Thanks a lot

@kaiserdj
Copy link
Author

image

@luisfpg
Copy link
Collaborator

luisfpg commented Jul 16, 2021

Sorry, I don't really have any more time to maintain this project.
Help is appreciated.

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

No branches or pull requests

2 participants