Skip to content

Commit c035675

Browse files
authored
Remove JSON Schema enumNames example (#4646)
* Remove JSON Schema enumNames example * improve clarity * improve clarity once more
1 parent 461d581 commit c035675

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

packages/docs/docs/json-schema/single.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,7 @@ const schema: RJSFSchema = {
107107
render(<Form schema={schema} validator={validator} />, document.getElementById('app'));
108108
```
109109

110-
In your JSON Schema, you may also specify `enumNames`, a non-standard field which RJSF can use to label an enumeration. **This behavior is deprecated and will be removed in a future major release of RJSF. Use the "ui:enumNames" property in the uiSchema instead.**
111-
112-
```tsx
113-
import { RJSFSchema } from '@rjsf/utils';
114-
import validator from '@rjsf/validator-ajv8';
115-
116-
const schema: RJSFSchema = {
117-
type: 'number',
118-
enum: [1, 2, 3],
119-
enumNames: ['one', 'two', 'three'],
120-
};
121-
render(<Form schema={schema} validator={validator} />, document.getElementById('app'));
122-
```
123-
124-
Same example using the `uiSchema`'s `ui:enumNames` instead.
110+
If you use `enum` in your JSON Schema, you may instead specify `ui:enumNames` in your `uiSchema`, which RJSF can use to label an enumeration.
125111

126112
```tsx
127113
import { RJSFSchema, UiSchema } from '@rjsf/utils';

0 commit comments

Comments
 (0)