Skip to content

AssertionError: expected 'number' to be 'string' #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gdams opened this issue Nov 24, 2020 · 1 comment
Open

AssertionError: expected 'number' to be 'string' #350

gdams opened this issue Nov 24, 2020 · 1 comment
Labels
wontfix This will not be worked on

Comments

@gdams
Copy link

gdams commented Nov 24, 2020

Describe the bug
It seems that the openapi parser stumbles over when you specify a type as an integer but specify the default in quotes (required for the swagger-ui).

To Reproduce
Steps to reproduce the behavior:

openapi-to-graphql https://staging-api.adoptopenjdk.net/openapi

(node:28060) UnhandledPromiseRejectionWarning: Could not validate OpenAPI Specification 'v3'. expected 'number' to be 'string'
(node:28060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:28060) [DEP0018] DeprecationWarning: Unhandled promise rejecti

Expected behavior
We should be able to parse the AdoptOpenJDK openapi specification but instead, it errors out.

Additional context
The error comes from the fact that the default is specified in double quotes. Removing the quotes fixes the parser but breaks the swagger-ui

        required: true
        schema:
          default: "8"
          type: integer

For more context see the following links:
microprofile/microprofile-open-api#420
smallrye/smallrye-open-api#300

@Alan-Cha
Copy link
Collaborator

Alan-Cha commented Dec 3, 2020

@gdams Sorry for the late reply but thank you for filling this issue!

This seems to be an error related to the Swagger/OAS validator package that we use. As a result, this is largely out our hands for the time being.

We do have an issue filed for possibly replacing the library or exposing it somehow so that users can provide their own validator. #334

@Alan-Cha Alan-Cha added the wontfix This will not be worked on label Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants