Skip to content

Configuring Schemas

The Schemas tab is where we view and define models to be used as request and/or response bodies. A schema defines properties that make up an object. It is considered good practice to declare reusable models as Schema Objects in the OpenAPI specification to avoid duplication and inconsistencies.

Schemas tab

Adding a New Schema

To create a schema:

Adding a new schema

  1. Go to the Schemas tab.
  2. Click the green plus button at the top.
  3. Specify the schema name.
  4. Click the floppy disk button to save.

Only after your schema has been saved can you proceed to defining object properties.

Property Fields

A schema is a collection of property definitions. A property is defined through the following fields:

Fields with an asterisk (*) are required

In order to add a property to the schema, required fields must be provided.

Name Description
Name* The name of the property.
Description Description of the property.
Type* The data type of the property.
Default Value The assumed value of the property if unprovided.
Array A boolean value indicating whether a property is an array or not.
Min A number dictating the lower limit of a numerical property.
Max A number dictating the upper limit of a numerical property.
Exclusive Min A boolean value specifying whether the lower limit set by the Min field is excluded or not (from the range of possible values).
Exclusive Max A boolean value specifying whether the upper limit set by the Max field is excluded or not (from the range of possible values).
Multiple Of Numerical properties will only be valid if their value is divisible by this field's value. This number must be greater than 0.
Min Length The minimum length of a string property. This field's value must be a non-negative integer.
Max Length The maximum length of a string property. This field's value must be a non-negative integer.
Pattern A regular expression that must match the string property's value.
Min Items A non-negative integer indicating the minimum number of items an array property should contain.
Max Items A non-negative integer indicating the maximum number of items an array property should contain.
Unique Items A boolean field indicating whether or not each of an array property's items should be unique.
Min Properties A non-negative integer used for specifying the minimum number of properties an object property should have.
Max Properties A non-negative integer used for specifying the maximum number of properties an object property should have.
Enum A collection of comma-separated possible values for this property.
Extra Properties A boolean field indicating whether or not this property, assuming it's type is object, can contain other properties other than the ones already declared.

User Interface

The Schemas tab, annotated

  • (1) Title field

    The name of the schema.

  • (2) Properties section

    This part of the tab shows the fields associated with each property.

  • (3) Add Property button

  • (4) Save Property button

    Once you've filled up the fields for a new property, or edited the field values of an existing property, click this button to save the new property or your updates.

  • (5) Delete Selected Property button

    Use this button to delete the currently selected property, whose field values are displayed in the Properties section.

  • (6) Delete All Properties button

  • (7) More Properties toggle

    Click this label to show more property fields.

  • (8) Properties tree

    This section shows all properties defined in the schema. Click any of the properties in the tree to select it.

Adding a New Property Manually

  1. Click the green plus button at the top of the Properties section.
  2. Define the property's fields by populating the text inputs in the Properties section, especially required fields. To show more property fields, click More Properties.
  3. Click the floppy disk button to save.
Define your object property's properties

To add properties to an object property, select your object property from the Properties tree and then click the Add Property button.

Editing an Existing Property

  1. Select the property you want to edit from the Properties tree.
  2. Edit fields using the text inputs.
  3. Click the floppy disk button to save.

Deleting an Existing Property

  1. Select the property you want to edit from the Properties tree.
  2. Click the red button, with an 'x' on top of the Properties section.
  3. Confirm your action.

To delete all properties, click the red button with two x's.

Defining Properties Through JSON Payloads

You can import properties defined in a JSON file or text. To do this:

  1. Select your schema.
  2. Click the JSON Payload button.

    JSON Payload button

  3. Click the Browse button to choose the JSON file or provide a JSON text using the text area in the modal.

  4. Click Convert.
  5. Confirm your action.