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

Duplicate static from* helper methods are produced #1121

Open
moltar opened this issue Jul 15, 2023 · 0 comments
Open

Duplicate static from* helper methods are produced #1121

moltar opened this issue Jul 15, 2023 · 0 comments

Comments

@moltar
Copy link

moltar commented Jul 15, 2023

Given the following snippet from a JSON Schema:

{
    "shell": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": ["bash", "pwsh", "python", "sh", "cmd", "powershell"]
        }
      ]
    }
}

Will produce invalid code, where fromString is duplicated:

export class Shell {
  public static fromString(value: string): Shell {
    return new Shell(value);
  }
  public static fromString(value: string): Shell {
    return new Shell(value);
  }
  private constructor(public readonly value: string | string) {
  }
}
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

No branches or pull requests

1 participant