mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +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.
|
||||
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
|
||||
if (
|
||||
(options?.mode === 'write' && schema.readOnly) ||
|
||||
|
||||
Reference in New Issue
Block a user