Skip to content

[BUG][PHP] Model name suffix incorrectly added to inline enum names #4403

@hinrik

Description

@hinrik

Consider this definition:

components:
  schemas:
    Foo:
      type: object
      properties:
        inline_enum:
          type: string
          enum: [one, two, three]
        referenced_enum:
            $ref: '#/components/schemas/ReferencedEnum'
    ReferencedEnum:
      type: string
      enum: [one, two, three]

If you generate PHP from this defintion using a modelNameSuffix=DTO option on the generator, the values of inline_enum will now change from being e.g. INLINE_ENUM_ONE to INLINE_ENUM_DTO_ONE, which doesn't make sense.

Values of ReferencedEnum are untouched, still ReferencedEnum::ONE (though they are unusable regardless for another reason).

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