Skip to content

Commit cd5a6b3

Browse files
committed
update fields
1 parent 4b25c8d commit cd5a6b3

File tree

1 file changed

+20
-36
lines changed

1 file changed

+20
-36
lines changed

components/fields.mdx

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Fields"
33
description: "Set parameters for your API or SDK references"
4-
icon: 'letter-text'
4+
icon: "letter-text"
55
---
66

77
Use fields to document API parameters and responses. There are two types of fields: parameter fields and response fields.
@@ -14,72 +14,56 @@ The `<ParamField>` component is used to define parameters for your APIs or SDKs.
1414
An example of a parameter field
1515
</ParamField>
1616

17-
<RequestExample>
18-
19-
```mdx Path Example
20-
<ParamField path="param" type="string">
17+
```mdx
18+
<ParamField path="param" type="string" required>
2119
An example of a parameter field
2220
</ParamField>
2321
```
2422

25-
```mdx Body Example
26-
<ParamField body="user_age" type="integer" default="0" required>
27-
The age of the user. Cannot be less than 0
28-
</ParamField>
29-
```
30-
31-
```mdx Response Example
32-
<ResponseField name="response" type="string" required>
33-
A response field example
34-
</ResponseField>
35-
```
36-
37-
</RequestExample>
38-
3923
### Properties
4024

4125
<ParamField body="query, path, body, or header" type="string">
42-
Whether it is a query, path, body, or header parameter followed by the name
26+
Whether the parameter is a query, path, body, or header. Followed by the parameter name.
4327
</ParamField>
4428

4529
<ParamField body="type" type="string">
46-
Expected type of the parameter's value
30+
Expected type of the parameter's value.
4731

48-
Supports `number`, `string`, `bool`, `object`.
32+
Supports `number`, `string`, `boolean`, `object`.
4933

5034
Arrays can be defined using the `[]` suffix. For example, `string[]`.
5135
</ParamField>
5236

5337
<ParamField body="required" type="boolean">
54-
Indicate whether the parameter is required
38+
Indicate whether the parameter is required.
5539
</ParamField>
5640

5741
<ParamField body="deprecated" type="boolean">
58-
Indicate whether the parameter is deprecated
42+
Indicate whether the parameter is deprecated.
5943
</ParamField>
6044

6145
<ParamField body="default" type="string">
62-
Default value used by the server if the request does not provide a value
46+
Default value used by the server if the request does not provide a value.
6347
</ParamField>
6448

6549
<ParamField body="initialValue" type="any">
66-
Value that will be used to initialize the playground
50+
Value that will be used to initialize the playground.
6751
</ParamField>
6852

6953
<ParamField body="placeholder" type="string">
70-
Placeholder text for the input in the playground
54+
Placeholder text for the input in the playground.
7155
</ParamField>
7256

7357
<ParamField body="children" type="string">
74-
Description of the parameter (markdown enabled)
58+
Description of the parameter (Markdown-enabled).
7559
</ParamField>
7660

7761
## Response field
7862

79-
The `<ResponseField>` component defines the return values of an API. Many docs also use `<ResponseField>` on pages when you need to list the types of something.
63+
The `<ResponseField>` component defines the return values of an API.
8064

8165
<ResponseField name="response" type="string" required>
82-
A response field example
66+
An example of a response field
8367
</ResponseField>
8468

8569
```mdx
@@ -91,29 +75,29 @@ The `<ResponseField>` component defines the return values of an API. Many docs a
9175
### Properties
9276

9377
<ResponseField name="name" type="string" required>
94-
The name of the response value
78+
The name of the response value.
9579
</ResponseField>
9680

9781
<ResponseField name="type" type="string" required>
9882
Expected type of the response value. This can be any arbitrary string.
9983
</ResponseField>
10084

10185
<ResponseField name="default" type="string">
102-
The default value
86+
The default value.
10387
</ResponseField>
10488

10589
<ResponseField name="required" type="boolean">
106-
Show "required" beside the field name
90+
Indicate whether the response is required.
10791
</ResponseField>
10892

10993
<ResponseField name="deprecated" type="boolean">
110-
Whether a field is deprecated
94+
Whether a field is deprecated.
11195
</ResponseField>
11296

11397
<ResponseField name="pre" type="string[]">
114-
Labels that are shown before the name of the field
98+
Labels that are shown before the name of the field.
11599
</ResponseField>
116100

117101
<ResponseField name="post" type="string[]">
118-
Labels that are shown after the name of the field
102+
Labels that are shown after the name of the field.
119103
</ResponseField>

0 commit comments

Comments
 (0)