Giter Site home page Giter Site logo

Comments (4)

muvaf avatar muvaf commented on May 30, 2024

Ugh, it turns out it doesn't run the checker for every word in the string; it just acts like an override map. I'll have to implement a converter for snake_field to CamelCase.

from terrajet.

muvaf avatar muvaf commented on May 30, 2024

I opened the PR but I'm having some second thoughts about whether we should do this for json tags. The advantage for users is that they will see nicer json tags, like someRouteTableID instead of someRouteTableId or vpcID instead of vpcId.

The risk is that the list of acronyms won't be full so we might end up in a situation that some fields are properly named, some not and we can't really add things to list because it'd be a breaking API change. Hence users would not be able to get a consistent experience.

cc @negz @ulucinar @turkenh

from terrajet.

muvaf avatar muvaf commented on May 30, 2024

Hmm Kubernetes resources do appear to care about this, there is status.podIP field in Pod. But it has status.podIPs as well which made me think that if we get pod_ips, the best we would do would be to convert it to podIps because we cannot really know whether it should be IPs of IPS without context.

from terrajet.

negz avatar negz commented on May 30, 2024

I'm having some second thoughts about whether we should do this for json tags

The goal is to match the cloud APIs as closely as possible, so I actually think not doing this for JSON tags might make sense in a lot of cases. For example I believe AWS APIs typically use JSON struct fields like vpcId or someArn, not vpcID and someARN. I thiiiiink GCP is like this too - I just checked https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/instances#DatabaseInstance and I see secondaryGceZone not secondaryGCEZone.

It would still be nice to correctly capitalise the actual Go struct fields in our types, in accordance with typical Go style. I could be convinced it's not the end of the world if it's not possible to do that though - there's plenty of precedent for relaxing style on generated code that humans don't need to interface with as often.

from terrajet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.