The first layer of intelligent Mock
Create a new test interface and add a return response
Select local mock
save send
Successfully generated mock data
Enter the browser, enter the URL
successful request
The second layer: custom smart mock
Click Project Settings -> Function Settings -> Mock Settings
Click New to customize the mock
Some data are not very general, such as pet store status available sold pending
Layer 3 return field advanced settings
Click for more advanced settings
save send
Every time the status is sent, it is random within three
Layer 4 Interface Level Custom Mock
Deadline status is peding
Then no matter how you send the state, it is pending
apifox will help you verify interface documents
If it is written as 123, it will remind you that the verification failed
You can also choose the provided Mock type (you can also write it yourself)
The data model can also choose the data type
The written rules can also be used by other interfaces of this data model
The fifth layer of advanced Mock (request different parameter values, the returned results are different)
Click Auto Generate to generate return data in a regular format
This will allow you to get the desired result when you enter the specified value
The sixth layer of advanced Mock template syntax
Click for details
Write code to generate more complex data structures
(e.g. you need a 2D table filled with data)
The seventh layer advanced Mock custom script