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

Remove field name decapitalization in the scheme #34

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Problem:

For consistency with DataFabric examples, we make field names start with lowercase letter. As a result, we convert the first character of field name in a go struct to lowercase. For example, MyField -> myField. However, the generated scheme names for fields like HTTPRoutes look a bit ugly: HTTPRoutes -> hTTPRoutes

Solution:

Because it is not a hard requirement for Avro scheme, we can use names like HTTPRoutes just fine.

long? HTTPRoutes = null;

CLOSES -- #33

Note:
The alternative here is to support go tags like

HTTPRoutes int64 `avro:"httpRoutes"

So that in the generated scheme, it will be:

long? httpRoutes = null;

However, that would lead to +173 lines of code (I originally went with that approach)

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING
    guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch on my own fork

Problem:

For consistency with DataFabric examples, we make field names start
with lowercase letter. As a result, we convert the first character
of field name in a go struct to lowercase. For example,
MyField -> myField. However, the generated scheme names for fields
like HTTPRoutes look a bit ugly: HTTPRoutes -> hTTPRoutes

Solution:

This is not a hard requirement for Avro scheme, we can use names like
HTTPRoutes just fine.

long? HTTPRoutes = null;

CLOSES -- #33
@pleshakov pleshakov requested a review from a team as a code owner March 5, 2024 20:52
@github-actions github-actions bot added the enhancement Pull requests for new features/feature enhancements label Mar 5, 2024
@pleshakov pleshakov merged commit f5b0474 into main Mar 6, 2024
10 checks passed
@pleshakov pleshakov deleted the feature/remove-decapitalization branch March 6, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants