hasura / hasura/graphql-engine

Rest API issue to create actions for POST HTTP methods

Open
#9,734 5 comments 0 reactions 0 assignees View on GitHub
actions/open-API k/bug t/gql-services
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
CLI Version (for CLI related issue): 2.27.o

### Environment

Docker image

### What is the current behaviour?

Hello,

I am trying to create action for one of the post Rest API call but while creating the action it gives me

[
{
"error_code": "Parse Error",
"message": "Unexpected token 'end'.",
"source_position": {
"end_column": 2,
"end_line": 20,
"start_column": 1,
"start_line": 20
}
}
]

attaching the below swagger to reproduce the issue any help would be appreciated.

But the GET endpoints are easily integrated.

### What is the expected behaviour?

The Post API call should be converted to Graphql mutuation

### How to reproduce the issue?

1. Please use the below swagger and create a action for the post call
2.
{ "openapi": "3.0.2", "info": { "title": "Optimisier API", "description": "", "contact": { "name": "Data ", "email": "test@test.com" }, "version": "0.1.4" }, "paths": { "/optimise": { "post": { "tags": [ "optimise" ], "summary": "Optimise", "operationId": "optimise_optimise_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OptimiserRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OptimiserResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } } } } } } }, "components": { "schemas": { "HTTPError": { "title": "HTTPError", "required": [ "detail" ], "type": "object", "properties": { "detail": { "title": "Detail", "type": "string" } }, "description": "HTTP error schema to be used when an HTTPException is thrown." }, "HTTPValidationError": { "title": "HTTPValidationError", "type": "object", "properties": { "detail": { "title": "Detail", "type": "array", "items": { "$ref": "#/components/schemas/ValidationError" } } } }, "OptimiserRequest": { "title": "OptimiserRequest", "required": [ "gene_name" ], "type": "object", "properties": { "gene_name": { "title": "Gene Name", "type": "string", "description": "The name of the gene" } } }, "OptimiserResponse": { "title": "OptimiserResponse", "type": "object", "properties": { "gene_name": { "title": "Gene Name", "type": "string" } } }, "ValidationError": { "title": "ValidationError", "required": [ "loc", "msg", "type" ], "type": "object", "properties": { "loc": { "title": "Location", "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] } }, "msg": { "title": "Message", "type": "string" }, "type": { "title": "Error Type", "type": "string" } } } } } }

### Screenshots or Screencast

image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.