Options to ignore certain struct fields/properties during code generation?
See original GitHub issueHello, I’m looking to ignore struct fields of certain types based on type names (these fields are not used in Java generated code)
If I try to do this in the implementation of KotlinTypeProcessor
, e.g. calling TypeSpec.Builder.propertySpecs.removeIf { }
, it’s too late.
I can do this easily in the StructType
constructor:
internal constructor(element: StructElement, namespaces: Map<NamespaceScope, String>)
: super(UserElementMixin(element, namespaces)) {
this.structType = element.type
this.fields = element.fields.filter { /* CONDITION */ }.map { Field(it, namespaces) }
}
But I want to make this more generic for everyone. How do I pass an option from ThriftyCompiler
so it can be picked up here?
Thanks,
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (2 by maintainers)
Top Results From Across the Web
inheritance - How to avoid code duplication of different structs ...
As I come from Java, I would extract a base class ShapeRenderer out of those and apply the fields canvas and origin into...
Read more >datastore: When loading kinds into structs, ignore items where ...
We process orders and we sometimes deprecate or are no longer interested in certain fields in an order. This means that during transaction ......
Read more >Fields - ent
Fields (or properties) in the schema are the attributes of the node. ... setting it to Nillable will generate a struct field with...
Read more >Integrate C Functions Using Legacy Code Tool - MathWorks
Options for the generated S-function. Use the legacy_code function to. Initialize the Legacy Code Tool data structure for a given C function. Generate...
Read more >Dynamic Source Code Generation and Compilation - .NET ...
Compile and generate dynamic source code in . ... a data structure known as a CodeDOM graph, which models the structure of some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds like a perfect job for a Python program 😃
Honestly, annotations sound like the perfect vehicle for metadata. Here’s an example of thrift annotations: