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:
- 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
- save it in a file test.yaml
- run
openapi-to-graphql test.yaml
- 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.
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.