Below is a list of commonly asked questions about schema plugins. Be sure to also review the following articles before getting started with schema plugins:
The schema supports the basic types defined by JSON schema, including:
For string fields, the schema supports the following formats:
For more information on the types and keywords the schema supports, see The JSON Schema specification.
The schema can take up a maximum of 10KB in memory. It can have a maximum of 256 properties.
The schema's size in memory is calculated based on the field types defined in the schema:
The size of a string is determined by the string's maximum length, which you're required to define for all string properties. For example, a string with a defined maximum length of 20 characters has a size of (1 byte/character) × 20 characters = 20 bytes.
The size of an array is calculated based on the maximum number of items the array can hold, and on its data type. An array that holds a maximum of 10 integers, for example, has a size of 10 × 4 bytes = 40 bytes.
An object's size varies depending on which fields it contains. For example, an object that contains 2 string fields, both with a maximum length of 100, and one number field, the size is 2 × 100 bytes + 8 bytes = 208 bytes.
Yes. Archived fields remain in the database, so they still count towards the amount of memory your schema takes up.
It means that the schema you’ve added doesn’t align with the JSON schema restrictions set by Wix. Follow the error message and amend your schema accordingly.
Some common error messages are explained in the JSON schema reference.
Currently you can extend the following objects:
Once you save the schema, you can only make non-breaking changes to it. Examples of non-breaking changes include:
You will receive an error if you try to make any breaking changes, such as:
It isn’t possible to delete fields from the schema, but you can archive them. An archived field remains in the database, but is hidden during read and write operations. Note that once you archive a certain key, you cannot use that key again in your schema, since it still appears in the database.
To archive a field, add the x-wix-archived
key to its object, and set the key's value to true
. To unarchive the field, set the value to false
or delete the x-wix-archived
key entirely.
An archived field is hidden during API calls, but it is still visible in the JSON schema you defined in your app's dashboard.
You can define any of four permissions when you create a field in the JSON schema:
owning-app
: The app that created the extended field.apps
: Any other apps that are installed on the user’s site.users-of-users
: An identified member or site visitor.user
: The site owner.Each field has its own set of permissions that are defined in the x-wix-permissions
object. For example, one field may give users and site visitors read and write permissions, but another field in the same schema can limit read and write to only other apps or the owning app.
Note that all fields defined in a schema in your app's dashboard automatically have owning-app
permissions, so there is no need to define those permissions explicitly.