Skip to content

Schema and auto-fill ​

Nimbus reads the validation rules of a route and uses them to check your JSON body and to fill it with test data.

How the schema is built ​

Nimbus reads your controllers, form requests and resources then it builds a schema from the rules it finds. It reads rules from form requests, inline validate() calls, rule objects, form request hooks and Spatie data objects.

To check a body against the schem, open the Body tab and choose JSON. The editor checks what you type against the schema.

Schema validation

Autofill a payload ​

  1. Open the Body tab of a route that has rules.
  2. Click Auto Fill.
  3. Review the values and change what you need.

AutoFill

Nimbus picks values from the rules and from the field names.

  • An email field gets an email address, a password field gets a random password, a uuid field gets a UUID and a date field gets a date.
  • Numeric fields stay within the min and max rules.
  • Fields with a regex, digits, alpha or alpha_dash rule get text that matches.
  • Fields with an ip, ipv4 or ipv6 rule get a valid address.
  • Optional fields that cannot be empty are sometimes left out instead of being sent empty.
  • Etc.

Autofill also works for Form Data and Form URL Encoded bodies.

Use real records for exists rules ​

A field with an exists:table,column rule is filled with a real value from your database, so the request passes validation.

  • Nimbus reads up to 20 values for each of its exists rules and keeps them in memory.
  • Each Auto Fill picks one of them at random. If a list is empty or not loaded yet, Nimbus uses a generated value.
  • Only the tables and columns named by the rules of the route are read.

To pick a specific record, click the database button next to Auto Fill. It opens a list named Existing records where you choose a value for each field. The list covers fields at the top level of the payload.

The existing records picker

When the schema cannot be read ​

  • An Extraction error banner means Nimbus could not read the full shape of the route. Click Error Info for details and a suggested fix.
  • A Route not found banner means the route comes from an OpenAPI file but is missing in your Laravel routes. Clear the route cache or sync your branch.
  • A Route is auto-detected notice means the route has no entry in the OpenAPI file.

To learn how routes are read, see How routes are read.