Json type in properties

Hey there, hope you have a great day.

I have two questions:

  1. What is the difference between type json and string?
  2. Why required properties doesn’t affect on json type?
    Something like this:
    {
    displayName: “Test”,
    name: “test”,
    type: “json”,
    default: “”,
    required: true,
    }

Thank you.

Hey @jellybean!

  1. JSON is a data structure where you can nest data. This data can be string, numbers, boolean etc. While a string contains a series of characters. You can learn more about them on MDN. If you’re building a node you should checkout the Node UI Element documentation.

  2. The required property should work for JSON type as well. Pinging @RicardoE105 for more information.

1 Like

Thanks dear @harshil1712, I know about the string and json types, I’m a programmer :smiley:
I meant what is the difference in node properties:
image
Both have this style. And it doesn’t validate value if the type is json.

When a field is required, it would be red if it was empty and also it prevents the node from executing. But I can’t see this behavior when I set {required: true} to a json property.

Currently, there is not difference It looks the same. However, in the future we might add a dedicated JSON editor for the type json, so it’s easy to input JSON data. That is why it’s a different data type.

1 Like

Thank u very much @RicardoE105 . Got it.