IBM / openapi-to-graphql

Translate APIs described by OpenAPI Specifications (OAS) into GraphQL

Home Page:https://developer.ibm.com/open/projects/openapi-to-graphql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conversion fails if there is a '#' in the url of a REST query

juliandm opened this issue · comments

Describe the bug
I was trying to run the cli on the aws s3 api schema but got following error:

OpenAPI-to-GraphQL creation event error: expected '/{Bucket}/{Key}#uploadId' not to contain '#' (false negative fail)

To Reproduce
Steps to reproduce the behavior:

  1. Download the raw aws s3 api schema https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/amazonaws.com/s3/2006-03-01/openapi.yaml
  2. save it in a file test.yaml
  3. run openapi-to-graphql test.yaml
  4. See error

Expected behavior
I expect it to parse

@juliandm This seems to be a good catch. I will try to take a look at this later today.

I took a look at this. This seems to be a problem with our OAS validator oas-validator. This is more evidence that we should switch to a different OAS validator.

Related: #410, #334

Huh, the interesting thing is that the maintainer of this OAS is also a maintainer of oas-validator.

I think this might be invalid according to OAS.

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-templating

The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by RFC3986: forward slashes (/), question marks (?), or hashes (#).

It seems like paths should not contain unescaped "#". As a result, I do not expect this should work. I will close this issue for now.