Skip to content

[Validation] Detect incorrectly defined dynamic mappings #624

@andrewkroh

Description

@andrewkroh

Detect cases where a developer thinks they have declared a dynamic mapping, but have not. Example:

    - name: disks.states.*
      type: object
      description: |
        map of raw disk states

The rule would detect fields where

  • name contains an asterisk
  • type == "object"
  • object_type is not set

Without specifying an object_type the result index template will declare a mapping for a literal name containing * asterisks and that is unexpected/surprising/wrong.

            "disks": {
              "properties": {
                "states": {
                  "properties": {
                    "*": {
                      "type": "object"
                    }
                  }
                }
              }
            },

Metadata

Metadata

Assignees

Labels

discussIssue needs discussion

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions