Skip to content

Conversation

@pquentin
Copy link
Member

Our recordings show two different errors paths. The first one is supported:

{
  "api": "indices.get_alias",
  "file": "/test/free/indices.get_alias/10_basic.yml",
  "name": "Getting alias on an non-existent index should return 404",
  "origin": "yaml",
  "request": {
    "args": {
      "index": "non-existent",
      "name": "foo"
    }
  },
  "response": {
    "headers": {
      "content-encoding": "gzip",
      "content-length": "164",
      "content-type": "application/json",
      "x-elastic-product": "Elasticsearch"
    },
    "payload": {
      "error": {
        "index": "non-existent",
        "index_uuid": "_na_",
        "reason": "no such index [non-existent]",
        "resource.id": "non-existent",
        "resource.type": "index_or_alias",
        "root_cause": [
          {
            "index": "non-existent",
            "index_uuid": "_na_",
            "reason": "no such index [non-existent]",
            "resource.id": "non-existent",
            "resource.type": "index_or_alias",
            "type": "index_not_found_exception"
          }
        ],
        "type": "index_not_found_exception"
      },
      "status": 404
    },
    "statusCode": 404
  }
}

But the second one was not supported:

{
  "api": "indices.get_alias",
  "file": "/test/free/indices.delete_alias/all_path_options.yml",
  "name": "check delete with * index",
  "origin": "yaml",
  "request": {
    "args": {
      "name": "alias1"
    }
  },
  "response": {
    "headers": {
      "content-encoding": "gzip",
      "content-length": "70",
      "content-type": "application/json",
      "x-elastic-product": "Elasticsearch"
    },
    "payload": {
      "error": "alias [alias1] missing",
      "status": 404
    },
    "statusCode": 404
  }
}

Not sure if changing ErrorResponseBase this way is OK or not.

@github-actions
Copy link
Contributor

Following you can find the validation results for the API you have changed.

API Status Request Response
indices.get_alias 🟢 86/86 86/86

You can validate this API yourself by using the make validate target.

@l-trotta
Copy link
Contributor

this is probably breaking for all static clients generator since it's a new union

@flobernd
Copy link
Member

Does this only apply to indices.get_alias?

@pquentin
Copy link
Member Author

Too bad. Can you think of a non breaking way to fix this? The common case is actually the second one, but of course less common than the happy path

@pquentin
Copy link
Member Author

@flobernd Sesrching the docs did turn up a few cases, but it seems pretty non standard.

@l-trotta
Copy link
Contributor

@pquentin let's bring this up in the next meeting, it's should be easy to map this, but we all have to be aware of the change

@pquentin
Copy link
Member Author

pquentin commented Oct 4, 2024

Closing as we'll be skipping this test instead.

@pquentin pquentin closed this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants