Open runeh opened 3 years ago
I haven't hit this edge-case yet. Thanks for adding the issue!
We actually ended up with a convention like this:
Schema
postfix: fooSchema
Foo
I think that Schema
part came from joi
world - it was used for runtime schema validation in pre-runtypes ages on my current project. But the point is still valid, we can just append something like Schema
or Runtype
or even just Rt
to the name to get different names even without uppercasing/lowercasing first letters.
Sounds reasonable. My suggestion, add Runtype
to runtypes, and uppercase they types like you say? And explain in docs that the behaviour can be overridden by the naming functions.
The default name formatter just uppercases the first letter. This doesn't work for types that use a non-alpha prefix. For example, given a value named
_links
, we now generate this code:We probably don't want the names to be identical, even though it's technically allowed I think.