Skip to content

Commit

Permalink
fix(pipeline-builder): fix semi-structured/json at start operator not…
Browse files Browse the repository at this point in the history
… obey the protocol (#962)

Because

When using semi-structured/json, the type in the metadata of start
operator need to be removed.
```
{
    "type": "object",
    "instillFormat": "semi-structured/json",
    "title": "www"
}
```

to

```
{
    "instillFormat": "semi-structured/json",
    "title": "www"
} 
```

This commit

- fix semi-structured/json at start operator not obey the protocol
  • Loading branch information
EiffelFly committed Feb 15, 2024
1 parent 29a25ab commit bd624a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/toolkit/src/lib/vdp-sdk/pipeline/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export type StartOperatorMetadata = Record<string, StartOperatorInput>;

export type StartOperatorInput = {
title: string;
type: StartOperatorInputType;
type?: StartOperatorInputType;
instillFormat: string;
items?: {
type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const StartNodeInputType = ({
icon = (
<Icons.BracketSlash className="m-auto h-4 w-4 stroke-semantic-fg-primary" />
);
label = "JSON object";
label = "JSON";
break;
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,11 @@ export const StartOperatorNode = ({ data, id }: NodeProps<StartNodeData>) => {
};
break;
}

// This is the special case. We use this input to store arbitrary JSON
// By protocol, it don't have a type
case "semi-structured/json": {
configuraton = {
type: "object",
instillFormat: "semi-structured/json",
title: formData.title,
description: formData.description,
Expand Down

0 comments on commit bd624a6

Please sign in to comment.