SWIRLS_
ReferenceSDKClient

Schemas

SDK reference for schemas — Create and manage reusable JSON Schema definitions for validation.

Create and manage reusable JSON Schema definitions for validation.

createSchema

Create a new JSON Schema definition that can be used for validation.

POST

Usage:

const result = await swirls.client.schemas.createSchema({
  projectId: '...',
  name: '...',
  label: '...',
})

Input:

ParameterTypeRequiredDescription
idstringNo
projectIdstringYes
folderIdstring | nullNo
namestringYes
labelstringYes
descriptionstringNo
schemaobjectNo

Output:

FieldTypeDescription
idstring

getSchema

Get a schema by ID

GET

Usage:

const result = await swirls.client.schemas.getSchema({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
createdAtunknown
orgIdstring | null
userIdstring

updateSchema

Update an existing schema.

PUT

Usage:

const result = await swirls.client.schemas.updateSchema({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
namestringNo
descriptionstringNo
schemaobjectNo
folderIdstring | nullNo

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
createdAtunknown
orgIdstring | null
userIdstring

deleteSchema

Delete a schema

DELETE

Usage:

const result = await swirls.client.schemas.deleteSchema({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

listSchemas

List all schemas in a project

GET

Usage:

const result = await swirls.client.schemas.listSchemas({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
folderIdstring | nullNo
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

searchSchemaCandidates

GET

Usage:

const result = await swirls.client.schemas.searchSchemaCandidates({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
querystringNo
excludeGraphIdstringNo
excludeNodeIdstringNo
limitnumberNo

On this page