Releases: CarstenWickner/react-jsonschema-inspector
Releases · CarstenWickner/react-jsonschema-inspector
Breadcrumbs Customisation
Added
- allow for custom rendering of breadcrumbs item via
breadcrumbs.renderItem
function - allow for rendering additional content in breadcrumbs via
breadcrumbs.renderTrailingContent
function
Fixed
- fix uncoloured gap on selected item that does not have nested items (introduced in 2.2.0)
Search by Property Name, Style Fixes & Storybook Docs
Added
- enabling search by matching property name, via new
searchOptions.byPropertyName
prop - providing
column
object and columnindex
as additional parameter tobreadcrumbs.skipSeparator
function (i.e. same input as forbreadcrumbs.mutateName
) - providing
optionIndexes
as additional parameter torenderItemContent
prop function
Changed
- enabling new
searchOptions.byPropertyName
prop in defaultsearchOptions
- style-fix: let long item names break over multiple lines within a column
- style-fix: disable the "outline" on
column
andcolview
(they were only shown in some browsers) - style-fix: make nested-item indicator white (instead of grey) on currently selected (blue) item
Additionally: the Storybook contents have been migrated to the new Storybook Docs and were extended by some additional stories for the various (complex) props being offered.
Simplified `anyOf`/`oneOf` support
Added
- exporting helper function
getFieldValueArrayFromSchemaGroup()
- exporting helper function
getCommonFieldValuesFromSchemaGroup()
- exporting helper function
getMaximumFieldValueFromSchemaGroup()
- exporting helper function
getMinimumFieldValueFromSchemaGroup()
Changed
- not including
anyOf
oroneOf
in<Inspector>
propparserConfig
no longer hides the respective schema parts (always including everything)
Removed
- "type" property in
<Inspector>
propparserConfig.anyOf
/parserConfig.oneOf
(i.e. always "asAdditionalColumn" behaviour from now on) - undocumented export of helper function
getFieldValueFromSchemaGroup()
, one of the four new helper functions should be used instead
Adjustment of default Details Form
Now respecting the validation logic behind allOf
by not simply listing all values for the same field, but rather semantically combining/merging them, e.g.
- for
"type"
only show those values that are consistently mentioned in all schema parts (only"type"
is not mentioned at all) - for
"minimum"
/"minLength"
/"minItems"
only show the highest value if there are multiple different values - for
"maximum"
/"maxLength"
/"maxItems"
only show the lowest value if there are multiple different values - combine
"const"
and"enum"
depending on the number of provided values (also consolidating them as for"type"
)
Major rewrite to fully support anyOf and oneOf
- A number of additional configuration options have been added
anyOf
andoneOf
parts of a schema can now be handled properly (i.e. are not being ignored anymore)- Ability to define how an array's items are being accessed (also treating them as separate items in breadcrumbs)
- Full internationalisation possible through various props.
- The main
Inspector
component is now being exposed as named (and not default) export.
Reduced Package Size
.npmignore was not defined correctly and resulted in a much bigger npm package than necessary (e.g. including tests).
Extended customising options for breadcrumbs
- Allow to mutate the name of a selected item when including it in breadcrumbs (e.g. to sanitise it).
- Allow skipping a breadcrumb (e.g. omitting the root schema selection)
- Include breadcrumbs as array parameter in
onSelect
callback.
Adding Search Support
- Offering free-text search input above inspector
- Configuration can be done by providing a simple search function.
- Configuration can be done via names of fields to search in, e.g.
["title", "description"]
. - Avoiding endless loops in case of circular references.
- Automatically consider sub-schemas.
- Automatically consider
$ref
-erences. - Use
lodash.debounce
to avoid performance issues when constantly filtering complex schemas.