schemars icon indicating copy to clipboard operation
schemars copied to clipboard

Support enumflags2::BitFlags and optional x-enumNames extension

Open andrew-lee-architect opened this issue 2 years ago • 0 comments

Support creating more useful schemas for BitFlags<T> types as define by the enumflags2 crate, by including the original enum in definitions. Also, add support for "x-enumNames" extension to JSON-Schema to preserve enum names for toolchains that support it. The extension works for any enum container.

Added a unit test demonstrating both features.

andrew-lee-architect avatar Jun 12 '23 15:06 andrew-lee-architect