Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename NamingStrategy to FieldNamingStrategy #178

Closed
Tracked by #176
Chuckame opened this issue Jan 27, 2024 · 3 comments · Fixed by #182
Closed
Tracked by #176

Rename NamingStrategy to FieldNamingStrategy #178

Chuckame opened this issue Jan 27, 2024 · 3 comments · Fixed by #182
Labels
enhancement New feature or request
Milestone

Comments

@Chuckame
Copy link
Contributor

Chuckame commented Jan 27, 2024

Current issue

Now, defining a naming strategy impacts both records' and fields' name... Well it seems. It only applies the naming strategy to field names (and the fixed names as it relies on the field name).

Proposal

Have a clear FieldNamingStrategy and improve the interface:

public interface FieldNamingStrategy {
    public fun resolve(
        descriptor: SerialDescriptor,
        elementIndex: Int,
    ): String

    public companion object Builtins {
        public object NoOp : FieldNamingStrategy {
            override fun resolve(
                descriptor: SerialDescriptor,
                elementIndex: Int,
            ): String = descriptor.getElementName(elementIndex)
        }

        public object SnakeCase : FieldNamingStrategy {
                // ...
        }

        public object PascalCase : {
                // ...
        }
    }
}
@Chuckame Chuckame added this to the Version 2 milestone Jan 27, 2024
Chuckame added a commit to Chuckame/avro4k that referenced this issue Jan 28, 2024
@Chuckame Chuckame linked a pull request Jan 28, 2024 that will close this issue
@Chuckame Chuckame mentioned this issue Jan 28, 2024
14 tasks
Chuckame added a commit to Chuckame/avro4k that referenced this issue Jan 28, 2024
Chuckame added a commit to Chuckame/avro4k that referenced this issue Feb 3, 2024
Chuckame added a commit to Chuckame/avro4k that referenced this issue Apr 10, 2024
@Chuckame
Copy link
Contributor Author

Done in #182

@Chuckame Chuckame added the enhancement New feature or request label May 23, 2024
@Chuckame Chuckame changed the title Split NamingStrategy to specific record and field strategies Rename NamingStrategy to FieldNamingStrategy May 23, 2024
@Chuckame
Copy link
Contributor Author

open it back, waiting for a real release

@Chuckame Chuckame reopened this May 23, 2024
@Chuckame
Copy link
Contributor Author

Released in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant