Skip to content

Inner URI Enums with useEnumCaseInsensitive causes compilation errors #20952

Open
@Chrimle

Description

@Chrimle

if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) {

The current implementation of inner enum classes are not working for:

  • <library>okhttp-gson</library>
  • <enumCaseInsensitive>true</enumCaseInsensitive>
  • type: string
  • format: uri

This would generate:

public static ExampleInnerThreeEnum fromValue(URI value) {
      for (ExampleInnerThreeEnum b : ExampleInnerThreeEnum.values()) {
        if (b.value.equalsIgnoreCase(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Which will cause compilation errors, since URI does not have a method equalsIgnoreCase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions