Skip to content

Commit 8e2e46a

Browse files
authored
Merge pull request #2756 from SzySteve/docs/deprecated
Add deprecated key to docs renderer
2 parents bbec7cf + a7f36ee commit 8e2e46a

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

docs/prebuild.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function formatSchemaField(schemaField, enumMap, filterDepth, iteration = 1) {
128128
description = convertUlToArray(description);
129129

130130
// eslint-disable-next-line max-len
131-
const { name, seeAlso, editable, filterable, optional, type, subtype, isArray, value } = schemaField;
131+
const { name, seeAlso, editable, filterable, optional, type, subtype, isArray, value, deprecated } = schemaField;
132132
let lowerType = type && _.isString(type) ? type.toLowerCase() : 'object';
133133

134134
let nestedSchema = null;
@@ -188,6 +188,7 @@ function formatSchemaField(schemaField, enumMap, filterDepth, iteration = 1) {
188188
isArray,
189189
type: lowerType,
190190
schema: nestedSchema,
191+
deprecated,
191192
};
192193
}
193194

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.FieldCell {
22
&-label {
33
margin-top: -5px;
4+
&-deprecated {
5+
color: red;
6+
}
47
}
58
}
69

docs/src/components/tables/cells/ParamFieldCell.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,26 @@ export default function ParamFieldCell(props) {
2020
);
2121
}
2222

23+
let deprecatedWarning;
24+
if (record.deprecated) {
25+
deprecatedWarning = (
26+
<div className="FieldCell-label-deprecated">
27+
<small>
28+
{record.deprecated}
29+
</small>
30+
</div>
31+
);
32+
}
33+
2334
return (
2435
<td className="TableCell FieldCell">
2536
<div>
2637
{record.name}
2738
</div>
2839
{subLabel}
40+
<div>
41+
{deprecatedWarning}
42+
</div>
2943
</td>
3044
);
3145
}

docs/src/data/endpoints/linodes.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ endpoints:
5353
The Distribution to deploy this Linode with. May not be included
5454
if 'backup_id' or 'image' is sent.
5555
type: String
56+
deprecated: This parameter is deprecated and will be removed before the end of the Beta Period.
57+
See the changelog for more information.
5658
root_pass:
5759
optional: unless source == "distro"
5860
description: >
@@ -195,7 +197,9 @@ endpoints:
195197
Optional distribution to deploy with this disk.
196198
<ul><li>If no distribution is provided, a blank disk
197199
is created.</li></ul> You may not provide distribution if image is provided.
198-
type: Distribution
200+
type: String
201+
deprecated: This parameter is deprecated and will be removed before the end of the Beta Period.
202+
See the changelog for more information.
199203
image:
200204
optional: true
201205
description: >
@@ -1009,9 +1013,12 @@ endpoints:
10091013
dangerous: true
10101014
params:
10111015
distribution:
1016+
optional: true
10121017
description: >
1013-
An Distribution to deploy to this Linode.
1014-
type: Distribution
1018+
An ID of a Distribution to deploy to this Linode.
1019+
type: String
1020+
deprecated: This parameter is deprecated and will be removed before the end of the Beta Period.
1021+
See the changelog for more information.
10151022
image:
10161023
optional: true
10171024
description: >

docs/src/data/objects/linode.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ schema:
7777
type: Distribution
7878
seeAlso: "/reference/endpoints/linode/distributions"
7979
filterable: true
80+
deprecated: This parameter is deprecated and will be removed before the end of the Beta Period.
81+
See the changelog for more information.
8082
group:
8183
editable: true
8284
type: String

0 commit comments

Comments
 (0)