graphql-engine/server/tests-py/queries/openapi/openapi_endpoint_with_multiple_methods.yaml
David Overton 63291f6de8 fix OpenAPI for mutiple methods on same REST endpoint path
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2603
GitOrigin-RevId: 32b3133f0bb1a9bf50e4db492bab1eabf5a9430c
2021-10-14 10:32:18 +00:00

202 lines
5.4 KiB
YAML

- description: Try to add a rest endpoint with multiple methods
url: /v1/query
status: 200
response:
message: success
query:
type: create_rest_endpoint
args:
url: multi_method_endpoint
name: multi_method_endpoint
methods:
- GET
- POST
- PUT
- DELETE
- PATCH
definition:
query:
collection_name: test_collection
query_name: mutation_with_args
- description: Call openapi json endpoint
url: /api/swagger/json
method: GET
status: 200
query:
response:
openapi: 3.0.0
info:
version: ''
title: Rest Endpoints
description: These OpenAPI specifications are automatically generated by Hasura.
paths:
/api/rest/multi_method_endpoint:
get:
summary: multi_method_endpoint
description: >-
***
The GraphQl query for this endpoint is:
``` graphql
mutation ($first_name: String!, $last_name: String!) {
insert_test_table( objects: {first_name: $first_name, last_name:
$last_name }) { returning { id } affected_rows } }
```
responses: {}
parameters:
- schema:
type: string
in: header
name: x-hasura-admin-secret
description: >-
Your x-hasura-admin-secret will be used for authentication of the API
request.
- schema:
type: string
in: query
name: first_name
- schema:
type: string
in: query
name: last_name
put:
summary: multi_method_endpoint
description: >-
***
The GraphQl query for this endpoint is:
``` graphql
mutation ($first_name: String!, $last_name: String!) {
insert_test_table( objects: {first_name: $first_name, last_name:
$last_name }) { returning { id } affected_rows } }
```
responses: {}
parameters:
- schema:
type: string
in: header
name: x-hasura-admin-secret
description: >-
Your x-hasura-admin-secret will be used for authentication of the API
request.
- schema:
type: string
in: query
name: first_name
- schema:
type: string
in: query
name: last_name
post:
summary: multi_method_endpoint
description: >-
***
The GraphQl query for this endpoint is:
``` graphql
mutation ($first_name: String!, $last_name: String!) {
insert_test_table( objects: {first_name: $first_name, last_name:
$last_name }) { returning { id } affected_rows } }
```
responses: {}
parameters:
- schema:
type: string
in: header
name: x-hasura-admin-secret
description: >-
Your x-hasura-admin-secret will be used for authentication of the API
request.
- schema:
type: string
in: query
name: first_name
- schema:
type: string
in: query
name: last_name
delete:
summary: multi_method_endpoint
description: >-
***
The GraphQl query for this endpoint is:
``` graphql
mutation ($first_name: String!, $last_name: String!) {
insert_test_table( objects: {first_name: $first_name, last_name:
$last_name }) { returning { id } affected_rows } }
```
responses: {}
parameters:
- schema:
type: string
in: header
name: x-hasura-admin-secret
description: >-
Your x-hasura-admin-secret will be used for authentication of the API
request.
- schema:
type: string
in: query
name: first_name
- schema:
type: string
in: query
name: last_name
patch:
summary: multi_method_endpoint
description: >-
***
The GraphQl query for this endpoint is:
``` graphql
mutation ($first_name: String!, $last_name: String!) {
insert_test_table( objects: {first_name: $first_name, last_name:
$last_name }) { returning { id } affected_rows } }
```
responses: {}
parameters:
- schema:
type: string
in: header
name: x-hasura-admin-secret
description: >-
Your x-hasura-admin-secret will be used for authentication of the API
request.
- schema:
type: string
in: query
name: first_name
- schema:
type: string
in: query
name: last_name
components: {}
- description: Try to remove the endpoint
url: /v1/query
status: 200
response:
message: success
query:
type: drop_rest_endpoint
args:
name: multi_method_endpoint