mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
Hide deprecated properties in examples (#3085)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@gitbook/react-openapi": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Hide deprecated properties in examples
|
||||||
@@ -166,6 +166,11 @@ const getExampleFromSchema = (
|
|||||||
// But if `emptyString` is set, we do want to see some values.
|
// But if `emptyString` is set, we do want to see some values.
|
||||||
const makeUpRandomData = !!options?.emptyString;
|
const makeUpRandomData = !!options?.emptyString;
|
||||||
|
|
||||||
|
// If the property is deprecated we don't show it in examples.
|
||||||
|
if (schema.deprecated) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the property is read-only/write-only
|
// Check if the property is read-only/write-only
|
||||||
if (
|
if (
|
||||||
(options?.mode === 'write' && schema.readOnly) ||
|
(options?.mode === 'write' && schema.readOnly) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user