OpenSearch/rest-api-spec/test/index
Boaz Leskes 9f10547f4b Allow 0 as a valid external version
Until now all version types have officially required the version to be a positive long number. Despite of this has being documented, ES versions <=1.0 did not enforce it when using the `external` version type. As a result people have succesfully indexed documents with 0 as a version. In 1.1. we introduced validation checks on incoming version values and causing indexing request to fail if the version was set to 0. While this is strictly speaking OK, we effectively have a situation where data already indexed does not match the version invariant.

To be lenient and adhere to spirit of our data backward compatibility policy, we have decided to allow 0 as a valid external version type. This is somewhat complicated as 0 is also the internal value of `MATCH_ANY`, which indicates requests should succeed regardles off the current doc version. To keep things simple, this commit changes the internal value of `MATCH_ANY` to `-3` for all version types.

Since we're doing this in a minor release (and because versions are stored in the transaction log), the default `internal` version type still accepts 0 as a `MATCH_ANY` value. This is not a problem for other version types as `MATCH_ANY` doesn't make sense in that context.

Closes #5662
2014-05-16 22:10:16 +02:00
..
10_with_id.yaml Remove hard-coded "ok": true from REST responses 2014-01-07 09:27:07 -07:00
15_without_id.yaml Remove hard-coded "ok": true from REST responses 2014-01-07 09:27:07 -07:00
20_optype.yaml Renamed "ok" and "not_ok" to "is_true" and "is_false" 2013-07-01 15:58:23 +02:00
30_internal_version.yaml Renamed "ok" and "not_ok" to "is_true" and "is_false" 2013-07-01 15:58:23 +02:00
35_external_version.yaml Allow 0 as a valid external version 2014-05-16 22:10:16 +02:00
36_external_gte_version.yaml Allow 0 as a valid external version 2014-05-16 22:10:16 +02:00
37_force_version.yaml Introduced VersionType.FORCE & VersionType.EXTERNAL_GTE 2014-03-10 21:07:17 +01:00
40_routing.yaml [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly 2014-04-07 17:08:05 +02:00
50_parent.yaml [TEST] split tests with parent to pre/post 1.0 in the yaml test suite 2014-01-02 20:04:24 +01:00
55_parent_with_routing.yaml [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly 2014-04-07 17:08:05 +02:00
60_refresh.yaml [TEST] decreased number of replicas to 0 in refresh tests 2014-03-31 11:28:34 +02:00
70_timestamp.yaml Renamed "ok" and "not_ok" to "is_true" and "is_false" 2013-07-01 15:58:23 +02:00
75_ttl.yaml [TEST] Fixed TTL tests for create, index, update 2014-03-31 15:13:14 +02:00
TODO.txt Added tests for info, ping and index 2013-06-27 11:34:43 +02:00