Skip to content

Commit

Permalink
KOGITO-9978: Include components schemas in workflow schemas (apache#2079
Browse files Browse the repository at this point in the history
)
  • Loading branch information
paulovmr authored Dec 5, 2023
1 parent 628368a commit 5b77b7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ describe("swf custom form tests", () => {

it("get custom workflow schema - success - with workflowdata", async () => {
const schema = {
components: {
schemas: {},
},
type: "object",
properties: {
name: {
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime-tools-gateway-api/src/gatewayApi/apis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ export const getCustomWorkflowSchemaFromApi = async (
// Components can contain the content of internal refs ($ref)
// This keeps the refs working while avoiding circular refs with the workflow itself
if (schema) {
const { [workflowName + "_input"]: _, components } = (api as any).components ?? {};
(schema as any)["components"] = components;
const { [workflowName + "_input"]: _, ...schemas } = (api as any).components?.schemas ?? {};
(schema as any)["components"] = { schemas };
}

return schema ?? null;
Expand Down

0 comments on commit 5b77b7a

Please sign in to comment.