schemars
schemars copied to clipboard
make generic type name format configurable.
currently, generic type names are generated using _for_ and _and_, it would be nice to have this configurable.
ref: https://github.com/GREsau/schemars/blob/5268080b014152912a910e3fe8524c4c876407de/schemars_derive/src/lib.rs#LL112C45-L112C45
e.g: I would prefer to have CommaSeparatedSimpleIdentifier instead of CommaSeparated_for_SimpleIdentifier here: https://github.com/php-rust-tools/parser/pull/234#discussion_r1051482050
In my case, the schema is used for generated PHP classes, Foo_for_Bar works as a PHP class name, but doesn't follow PSR-2 standards ( which says that class names much be studly cased ).
Would love to see this too!
I'm using this to generate typescript types by rust(schemars) -> jsonschema -> typescript and would prefer the underscore to be omitted.
Currently my workaround is search and replace /For_/g with "For" and just avoid using For` in my types.