Skip to content
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

Path object param check fails in OpenAPI spec #4933

Closed
2 of 4 tasks
hunterpetersen opened this issue Dec 12, 2022 · 0 comments · Fixed by #4934
Closed
2 of 4 tasks

Path object param check fails in OpenAPI spec #4933

hunterpetersen opened this issue Dec 12, 2022 · 0 comments · Fixed by #4934

Comments

@hunterpetersen
Copy link
Contributor

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

When parsing certain OpenAPI specs, the schema options in OpenAPI/omnigraph assume all elements of a Path Item Object are API methods (i.e. GET/POST/UPDATE/DELETE) and does not account for the possibility of the summary and description fields that may be included in this group. This leads to the an attempt to parse these fields as a method and introduces breaking behavior.

To Reproduce
Steps to reproduce the behavior:

Use any OpenAPI spec json/yaml that includes additional fields in the Path Item Object, such as this:
https://github.com/PagerDuty/api-schema/blob/main/reference/REST/openapiv3.json

summary and description are allowable fields in the Path Item Object in accordance with OpenAPI standards, see docs here: https://swagger.io/specification/

Expected behavior

The library should not attempt to parse the summary and description fields as method routes and instead should ignore them.

Environment:

  • OS: macOS Monterey 12.6.1
  • @graphql-mesh/openapi:
  • NodeJS: 14.19.0

Additional context

Extending the ignore method check to also include summary and description fixes the issue:
if (method === 'parameters' || method === 'summary' || method === 'description') { continue; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant