2021-02-24 07:30:12 +03:00
|
|
|
description: Tries to create an endpoint with trailing slash
|
|
|
|
url: /v1/query
|
|
|
|
status: 400
|
|
|
|
response:
|
2021-03-10 08:25:12 +03:00
|
|
|
internal:
|
2021-05-19 08:01:54 +03:00
|
|
|
- definition:
|
|
|
|
definition:
|
|
|
|
query:
|
|
|
|
collection_name: test_collection
|
|
|
|
query_name: simple_query
|
|
|
|
url: foo/
|
|
|
|
methods:
|
|
|
|
- GET
|
|
|
|
name: trailing
|
|
|
|
comment:
|
|
|
|
reason: "Empty segments or unnamed variables are not allowed: foo/"
|
|
|
|
name: endpoint trailing
|
|
|
|
type: endpoint
|
2021-02-24 07:30:12 +03:00
|
|
|
path: $.args
|
server: fix erroneous Eq instance on Metadata Object
During the "generalization" of the code, we removed the [generated instances](https://github.com/hasura/graphql-engine-mono/commit/9d631878037637f3ed2994b5d0525efd978f7b8f#diff-7b8382ab20e441fa214586be491eb6f7ca904d8b20ed97894c16a339be45219aL72) of `Eq` and `Hashable` in favour of manually written ones, because for a time we were struggling with `AnyBackend`.
In the process, we lost one constructor, `MOEndpoint`. It's unlikely to have ever been an issue, since duplicate endpoints are unlikely, but it is nonetheless wrong.
This PR simply goes back to default derived instances, now that we can, fixing the problem and making the code simpler.
---
However, after filing this PR, I realized **it broke rest endpoint tests**. Upon closer inspection, it turns out that while we had proper checks in place, because of this bug we were actually failing _differently_ during metadata checks. This PR actually improves error messages for invalid endpoint configurations?! :scream_cat:
This is a tiny bit scary. ^^'
https://github.com/hasura/graphql-engine-mono/pull/1762
GitOrigin-RevId: c4897d1f3ae92d18c44c87d2f58258c66f716686
2021-07-20 17:23:52 +03:00
|
|
|
error: 'Empty segments or unnamed variables are not allowed: foo/'
|
|
|
|
code: invalid-configuration
|
2021-02-24 07:30:12 +03:00
|
|
|
query:
|
|
|
|
type: create_rest_endpoint
|
|
|
|
args:
|
|
|
|
url: "foo/"
|
2021-03-10 08:25:12 +03:00
|
|
|
name: trailing
|
2021-02-24 07:30:12 +03:00
|
|
|
methods:
|
|
|
|
- GET
|
|
|
|
definition:
|
|
|
|
query:
|
|
|
|
collection_name: test_collection
|
|
|
|
query_name: simple_query
|