graphql-engine/server/tests-py/queries/endpoints
Lyndon Maydwell 0c1016e065 Inconsistent metadata support for REST endpoints
Previously invalid REST endpoints would throw errors during schema cache build.

This PR changes the validation to instead add to the inconsistent metadata objects in order to allow use of `allow_inconsistent_metadata` with inconsistent REST endpoints.

All non-fatal endpoint definition errors are returned as inconsistent metadata warnings/errors depending on the use of `allow_inconsistent_metadata`. The endpoints with issues are then created and return informational runtime errors when they are called.

Console impact when creating endpoints is that error messages now refer to metadata inconsistencies rather than REST feature at the top level:

![image](https://user-images.githubusercontent.com/92299/109911843-ede9ec00-7cfe-11eb-9c55-7cf924d662a6.png)

<img width="969" alt="image" src="https://user-images.githubusercontent.com/92299/110258597-8336fa00-7ff7-11eb-872c-bfca945aa0e8.png">

Note: Conflicting endpoints generate one error per conflicting set of endpoints due to the implementation of `groupInconsistentMetadataById` and `imObjectIds`. This is done to ensure that error messages are terse, but may pose errors if there are some assumptions made surrounding `imObjectIds`.

Related to https://github.com/hasura/graphql-engine-mono/pull/473 (Allow Inconsistent Metadata (v2) #473 (Merged))

---

### Kodiak commit message

Changes the validation to use inconsistent metadata objects for REST endpoint issues.

#### Commit title

Inconsistent metadata for REST endpoints

GitOrigin-RevId: b9de971208e9bb0a319c57df8dace44cb115ff66
2021-03-10 05:26:10 +00:00
..
endpoint_conflicting.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_dropped.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_duplicate_param.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_empty_path_param.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_empty_path_segment.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_empty_path.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_missing.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple_cached.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple_wrong_method.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_subscription.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
endpoint_trailing_slash.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_with_body_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_multiple_query_args.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_missing_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded_2.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_template.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
setup.yaml REST Endpoints - Prohibit Invalid slashes, duplicate variables, non-singular query definitions, subscriptions 2021-02-24 04:31:05 +00:00
teardown.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00