[
https://issues.apache.org/jira/browse/TEXT-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849453#comment-17849453
]
Gary D. Gregory commented on TEXT-217:
--------------------------------------
Hi [~claude]
This could both be useful but also a source of endless requests and/or bugs,
which is why I would like to see exact format definitions or links to
definitions. For example, for me, camel case starts with a lowercase, like a
Java method name.
I have many projects at work that use custom converters but I am not sure how
this would fit in because I prefer to see real tests than what is currently in
PR 552. It also does not seem to match what I think of camel case.
This is what I have custom converters for at work in different products:
The input can be any of XML Schema, WSDL (SOAP), Swagger 2, Open API 3.x, COBOL
copybooks, database tables (table names and column names), and probably other
specifications I can't recall. I've worked on many products! ;-)
Then, for example, I need to take an XML element name and make that a Java
class name and/or a method name; the same for an XML attribute name. Another
example is taking XML element and attribute names and turning those into
Swagger 2 and Open API 3 keys. In the case of converting into XML or into Open
API, it's not good enough for the names to be legal, they have to be "pretty",
in the conventions of a format. In Open API, that's camel case starting with a
lowercase letter. For XML, there are different conventions, so we pick one.
> Snake case utility method: CaseUtils.toSnakeCase(....)
> ------------------------------------------------------
>
> Key: TEXT-217
> URL: https://issues.apache.org/jira/browse/TEXT-217
> Project: Commons Text
> Issue Type: New Feature
> Affects Versions: 1.9
> Reporter: Adil Iqbal
> Assignee: Claude Warren
> Priority: Major
> Fix For: 1.12.1
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Requesting a feature to convert any string to snake case, as per
> CaseUtils.toCamelCase(...)
> *Rationale:*
> As per the OpenAPI Specification 3.0, keys should be in snake case. There is
> currently no common utility that can be used to accomplish that task.
> Any interaction between Java and Python is hindered, since Python uses snake
> case as a best practice.
> *Feature Set Requested:*
> All features currently included in CaseUtils.toCamelCase(...) sans
> capitalization flag. As you know, the capitalization flag was implemented to
> support PascalCase, which is a convention even in Java, for many situations.
> There is no equivalent for snake case.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)