Server Version: v2.1.0-beta.2
CLI Version (for CLI related issue):
Environment
OSS
What is the expected behaviour?
When retrieving an auto-generated Swagger doc for a REST endpoint,
It should generate a valid OpenAPI spec document and it should include at least a successful response object,
So that the generated OpenAPI Spec can be used in code-gen tools that consume these spec files without it needing to be significantly modified.
Keywords
swagger, openapi, rest
What is the current behaviour?
When generating a swagger document for a REST endpoint there are several things missing:
All of the information for the responses are also missing. I would be expecting at least information for 200 and 4XX responses. - I would expect the 200 responses to include the properties returned by the GraphQL query to be listed in the response "schema", and it should show as either an array response or an object response.
400 responses ideally would also document the properties of the response object too.
How to reproduce the issue?
Setup a REST endpoint in Hasura
Generate the swagger doc by visiting "/api/swagger/json"
Put that swagger doc json file into an OpenAPI spec editor. There will be several errors shown.
Screenshots or Screencast
Any possible solutions?
If a REST endpoint includes parameterized variables, mark them as required in the spec.
For the 200 responses for each REST endpoint, use the existing GraphQL schema to generate the required schema object in the Swagger document.
For the 4XX responses for each REST endpoint, just include a standard schema documenting the standard Hasura error json payload.
Can you identify the location in the source code where the problem exists?
No idea sorry
If the bug is confirmed, would you be willing to submit a PR?
Version Information
Server Version: v2.1.0-beta.2 CLI Version (for CLI related issue):
Environment
OSS
What is the expected behaviour?
When retrieving an auto-generated Swagger doc for a REST endpoint, It should generate a valid OpenAPI spec document and it should include at least a successful response object, So that the generated OpenAPI Spec can be used in code-gen tools that consume these spec files without it needing to be significantly modified.
Keywords
swagger, openapi, rest
What is the current behaviour?
When generating a swagger document for a REST endpoint there are several things missing:
How to reproduce the issue?
Screenshots or Screencast
Any possible solutions?
If a REST endpoint includes parameterized variables, mark them as required in the spec.
For the 200 responses for each REST endpoint, use the existing GraphQL schema to generate the required schema object in the Swagger document.
For the 4XX responses for each REST endpoint, just include a standard schema documenting the standard Hasura error json payload.
Can you identify the location in the source code where the problem exists?
No idea sorry
If the bug is confirmed, would you be willing to submit a PR?
Don't know how sorry.