Hide deprecated properties in examples (#3085)

This commit is contained in:
Greg Bergé
2025-04-03 19:40:52 +02:00
committed by GitHub
parent 70c4182fd8
commit 23cedd2d8b
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -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) ||