# schema-enum-naming

Source: https://apigenie.pl/docs/linter/openapi/rules/schema-enum-naming

This rule ensures that all string values defined in `enum` or `const`
properties of schema objects adhere to a predefined naming convention.

## Rule Details

Adhering to a consistent naming convention enhances the readability and
maintainability of the API's structure.

The `schema-enum-naming` rule is designed to ensure that all string values
defined in `enum` or `const` properties of schema objects adhere to a
predefined naming convention. Currently supported naming conventions are
`const`, `camel`, `camel-strict`, `kebab`, `pascal`, `pascal-strict`, `header`, and
`snake` (the strict forms reject two capitals in a row, e.g. `userID`).

## Configuration

The configuration block is a naming conventing name. Its default value is
`const`.

```yaml
lint:
  rules:
    paths-max-count:
      - warning
      - kebab
```

## Examples

**Good**.

```yaml
components:
  schemas:
    UserStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
        - BLOCKED
```

**Bad**. To use `UsesStatus` properly, a user must always consult the
documentation.

```yaml
components:
  schemas:
    UserStatus:
      type: string
      enum:
        - activeStatus
        - inactive_status
        - BLOCKED_STATUS
        - blocked_status
```

## When Not to Use It

If your API does not follow a specific naming convention for `enum` or `const`
values in its schema objects, you may not need to use this rule.

## Compatibility

This rule is compatible with all OpenAPI 3.x versions.
