I think adding the convention to our code-style guidelines [1] makes sense.
In addition, I wonder if this can be enforced with some code-style checking
tools.

What impact (if any) will there be on existing users?

Virtually every tooling against the REST API will break. Users that
> generated a client from the OpenAPI spec should only have to regenerate the
> client.



> If we are changing behavior how will we phase out the older behavior?

It is theoretically possible to duplicate all fields/parameters in the 1.x
> APIs, but it would double the serialization overhead and invite a new
> classes of bugs (== both fields being in the request / consistency errors
> between supposedly identical fields).
>

In this case, I wonder if it makes sense to bump the REST API version to
V2. That should allow us to gradually phase out the old APIs without the
above mentioned problems.

@Jing
You can find how many REST API fields / parameters using hyphens in the
OpenAPI yaml [2].

Best,

Xintong


[1]
https://flink.apache.org/how-to-contribute/code-style-and-quality-preamble/
[2]
https://github.com/apache/flink/blob/master/docs/static/generated/rest_v1_dispatcher.yml

On Mon, Jul 24, 2023 at 11:56 PM Jing Ge <j...@ververica.com.invalid> wrote:

> camel case is the standard code convention in Java since day one[1]. We
> don't need to describe it again for Flink. Legacy hyphens might be coded by
> contributors with other language backgrounds. If we really care about it,
> it might make sense to add the reference.
>
> It would be great if the FLIP could show one hyphen example, so that we
> will know what the issue exactly is and how many classes are involved in.
>
> Best regards,
> Jing
>
> [1]
>
> https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
>
> On Mon, Jul 24, 2023 at 9:09 PM Matthias Pohl
> <matthias.p...@aiven.io.invalid> wrote:
>
> > Do we have conventions on how the REST API should be formatted written
> down
> > somewhere?
> > Checking our coding conventions [1] didn't reveal anything.
> >
> > We could refer to a style guide like [2] to cover this topic. That would
> > also include the camel-cased JSON fields.
> >
> > [1]
> >
> https://flink.apache.org/how-to-contribute/code-style-and-quality-preamble/
> > [2]
> >
> >
> https://google.github.io/styleguide/jsoncstyleguide.xml?showone=Property_Name_Format#Property_Name_Format
> >
> > On Mon, Jul 24, 2023 at 1:03 PM Chesnay Schepler <ches...@apache.org>
> > wrote:
> >
> > > Make the REST API more consistent and easier to work with from the UI.
> > >
> > >
> >
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=263425799
> > >
> >
>

Reply via email to