Skip to content

Does Vendor actually support simple-json? #2949

Answered by michaelbromley
meatandfat asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

The "simple-json" type only exists internally in TypeORM - as far as the database is concerned, it's just a string of text. TypeORM is responsible for serializing & deserializing the data into the expected object.

In terms of custom fields (like your infoUrls example), the type: 'simple-json' is not valid in Vendure. The permitted custom field types are listed here: https://docs.vendure.io/guides/developer-guide/custom-fields/#available-custom-field-types

This line:

For lists of primitive types (anything except relation), the database type will be set to simple-json which serializes the data into a JSON string

just means that internally, if you set a custom field to e.g. { type: 'st…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@meatandfat
Comment options

Answer selected by meatandfat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants