-
Hey there, as discussed on Discord (starting here), we're trying to consume the Jira OAS in mesh. After some clean-up of the spec, we were able to use it with It did not work our right away with the Here are some findings, perhaps the list will grow. I can chop it into several issues later on if required/helpful. Was tested w/
1Atlassian provides the response samples as Reproduction
.meshrc.yaml sources:
- name: Jira
handler:
newOpenapi:
oasFilePath: https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json 1.patch 109c109,112
< const sample = typeof operationResponseConfig.responseSample === 'object'
---
> const sample = (
> typeof operationResponseConfig.responseSample === 'object'
> || typeof operationResponseConfig.responseSample === 'string'
> ) Errorsbefore patching Jira: Failed to generate the schema
at /Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:116:23
at async (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:112:15)
Error: responseSample - ENOENT: no such file or directory, open '/Users/.../mesh-jira-oas/{"errorMessages":["Connect and Forge app users with Administer Jira global permission can override screen security."],"errors":{}}'
at async getReferencedJSONSchemaFromOperations (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:168:49)
at async getDereferencedJSONSchemaFromOperations (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:255:34)
at async Object.createBundle (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:1649:32)
at async Object.getWithSet (/Users/.../mesh-jira-oas/node_modules/@graphql-mesh/store/index.js:148:38)
at async OpenAPIHandler.getMeshSource (/Users/...mesh-jira-oas/node_modules/@graphql-mesh/new-openapi/index.js:38:24)
at async /Users/.../mesh-jira-oas/node_modules/@graphql-mesh/runtime/index.js:39:28 after patching 🕸️ - Jira: Failed to generate the schema
TypeError: Cannot read properties of undefined (reading 'trim')
at Object.sanitizeNameForGraphQL (/private/tmp/x/node_modules/@graphql-mesh/utils/index.js:524:36)
at getValidTypeName (/private/tmp/x/node_modules/@omnigraph/json-schema/index.js:522:33)
at getTypeComposer (/private/tmp/x/node_modules/@omnigraph/json-schema/index.js:1552:35)
at mutateFn (/private/tmp/x/node_modules/@omnigraph/json-schema/index.js:1599:24)
at visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:192:41)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:120:43)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async Object.visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
🕸️: An error occured while writing the schema file: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/private/tmp/x/node_modules/@graphql-mesh/runtime/index.js:69:15)
🕸️: An error occurred while building the artifacts: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/private/tmp/x/node_modules/@graphql-mesh/runtime/index.js:69:15)
🕸️ - Server: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/private/tmp/x/node_modules/@graphql-mesh/runtime/index.js:69:15)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2
Reproduction
DetailsExample error (full debug log attached below) 🕸️ - Jira: GraphQL Type cannot be created for this JSON Schema definition;
subSchema: { $resolvedRef: "/paths/~1rest~1api~13~1workflowscheme~1{id}/delete/responses/204/content/application~1json/schema", title: "deleteWorkflowScheme_204_response" } 3
Reproduction
2.patch 523a524
> if(unsafeName === undefined) unsafeName = "MISSING" Detailserror before patching TypeError: Cannot read properties of undefined (reading 'trim')
at Object.sanitizeNameForGraphQL (/Users/.../mesh-jira-oas/node_modules/@graphql-mesh/utils/index.js:524:36)
at getValidTypeName (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:522:33)
at getTypeComposer (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:1552:35)
at mutateFn (/Users/.../mesh-jira-oas/node_modules/@omnigraph/json-schema/index.js:1599:24)
at visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:192:41)
at async visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:120:43)
at async visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:163:62)
at async Object.visitJSONSchema (/Users/.../mesh-jira-oas/node_modules/json-machete/index.js:163:62) error after patching 🕸️ - Jira: Failed to generate the schema
TypeError: Cannot read properties of undefined (reading 'getFields')
at getTypeComposer (/private/tmp/x/node_modules/@omnigraph/json-schema/index.js:988:73)
at mutateFn (/private/tmp/x/node_modules/@omnigraph/json-schema/index.js:1599:24)
at visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:192:41)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:120:43)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:120:43)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
at async visitJSONSchema (/private/tmp/x/node_modules/json-machete/index.js:163:62)
🕸️: An error occured while writing the schema file: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at Object.getMesh (/private/tmp/x/node_modules/@graphql-mesh/runtime/index.js:69:15)
🕸️: An error occurred while building the artifacts: Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output. 4There are additional errors in the logs that didn't seem to break the schema generation right away.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
In order to helpyou better, we need a clear reproduction. Maybe an example openapi file for that. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I realize now the findings were really not optimized for easy consumption. I updated the the original post with reproduction steps. Hope it's better now. This is not so much a question as the report on how the new OAS handler did on the Jira OAS as prev. discussed. TL;DR: With my current knowledge, I feel making the new OAS handler able to deal with the Jira spec is quite some effort. But I'd love to learn I'm mistaken re my judgement. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Thank you for all those details which are REALLY helpful! I haven't tested any of the queries or mutations and checked if the generated schema correctly represents what OpenAPI schema has. Waiting for your feedback. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
To wrap this up: We were able to use the new openapi handler from Thanks so much for the support & patching right away! 🙌 🙏 |
Beta Was this translation helpful? Give feedback.
To wrap this up: We were able to use the new openapi handler from
@omnigraph/openapi@0.5.0
(which contains @ardatan's PR ^^^) on its own for stitching the Jira OAS API into an existing gateway.Thanks so much for the support & patching right away! 🙌 🙏