swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

config "enumPropertyNaming" not working as expected

Open yog27ray opened this issue 1 year ago • 0 comments

Description

Enum are generated without underscore

expected output

export enum ActionLogTypeEnum {
    REGIMEN_CHANGE = 'REGIMEN_CHANGE',
    INSTRUCTION_CHANGE = 'INSTRUCTION_CHANGE',
    INSTANT_CHECKUP_DELETE = 'INSTANT_CHECKUP_DELETE',
    INSTANT_CHECKUP_TYPE_CHANGED = 'INSTANT_CHECKUP_TYPE_CHANGED'
}

actual output

export enum ActionLogTypeEnum {
    REGIMENCHANGE = 'REGIMEN_CHANGE',
    INSTRUCTIONCHANGE = 'INSTRUCTION_CHANGE',
    INSTANTCHECKUPDELETE = 'INSTANT_CHECKUP_DELETE',
    INSTANTCHECKUPTYPECHANGED = 'INSTANT_CHECKUP_TYPE_CHANGED'
}

Yaml File

Swagger-codegen version

3.0.55

Swagger declaration file content or url
openapi: 3.0.3
info:
  title: Test Schema
  version: 0.0.1
paths: {}
components:
  schemas:
    ActionLog:
      type: object
      properties:
        type:
          type: string
          enum:
            - REGIMEN_CHANGE
            - INSTRUCTION_CHANGE
            - INSTANT_CHECKUP_DELETE
            - INSTANT_CHECKUP_TYPE_CHANGED
Command line used for generation

java -jar ./swagger-codegen-cli.jar generate -i ./test/test.schema.yaml -l typescript-axios -o ./test --additional-properties modelPropertyNaming=original enumPropertyNaming=original

yog27ray avatar Apr 27 '24 04:04 yog27ray