Comments (4)
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.
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.
from terrajet.
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.
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)
- Reference network interface in VM creation
- How to deploy into existing infrastructure? HOT 2
- Customizable late initialization function for a resource
- Add support for numeric sensitive fields
- PollInterval is not considered by controllers
- main.tf's error message on failed write is incorrect
- Fix security vulnerabilities with hashicorp/go-getter upgrade to v1.6.1 HOT 1
- Fix security vulnerabilities by using Go 1.19 HOT 2
- can't get the correct terraform state file when importing the existed resources HOT 3
- Update documentation and provider-jet-template repo to cover creating a crossplane provider from a CUSTOM Terraform provider
- Allow resource configuration to provide additional state file values
- Terrajet providers take a long time on cluster with many resources HOT 2
- Issue when trying to convert ldap provider
- Need tip with converting ldap provider HOT 12
- Import cycle not allowed HOT 1
- Allow prevent_destroy for provider
- Using "Test":true in TF_REATTACH_PROVIDER cause memory leaks
- Cannot generate provider crds HOT 2
- Support configuring the json tags of a field
- Deprecating Terrajet HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terrajet.