Forum Discussion

shawld2's avatar
shawld2
New Member
9 months ago

Enums with negative values causing errors

Hi,

I using the ng-openapi-gen cli tool with Angular.

I'm using a negative enum in my API which is causing errors in the generated code due to duplicate identifiers.

 

export enum Messages {
  $100 = 100,
  $200 = 200,
  $200 = -200,
  $100 = -100
}
 
When i used the v2 swagger gen tools the model was generated like this:

export type Messages =  100 | 200 | -200 | -100;

 

Is there a config option that will fix this issue?

Many thanks

Lee

 

 

No RepliesBe the first to reply