Questions tagged [codegen]

Use codegen for questions related to language features or tools which facilitate translating code between languages or creating code from metadata

References

242 questions
30
votes
5 answers

Unable to find any GraphQL type definitions for the following pointers: src/**/*.graphql

I am using the @graphql-codegen/cli tool to generate typescript types out of my graphql server. Here is my codegen.yml content: overwrite: true schema: "http://localhost:3001/graphql" documents: "src/**/*.graphql" generates: …
TheSoul
  • 4,906
  • 13
  • 44
  • 74
29
votes
2 answers

What's the use of Moshi's Kotlin codegen?

I've recently started using Moshi for my Android app and I'm curious to know more about what the annotation @JsonClass(generateAdapter = true) really does. Example data class: data class Person( val name: String ) I'm able to…
Jignesh Shah
  • 599
  • 1
  • 5
  • 13
24
votes
5 answers

Apache Spark Codegen Stage grows beyond 64 KB

I'm getting an error when I'm feature engineering on 30+ columns to create about 200+ columns. It is not failing the job, but the ERROR shows. I want to know how can I avoid this. Spark - 2.3.1 Python - 3.6 Cluster Config - 1 Master - 32 GB RAM, 16…
Aakash Basu
  • 1,689
  • 7
  • 28
  • 57
16
votes
3 answers

swagger codegen is overwriting my custom code in generated files

I used the swagger codegen to generate jaxrs server side classes and also client side java classes. This is the command I used to generate the classes java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.2-M1.jar …
Nikhil S
  • 161
  • 1
  • 1
  • 4
13
votes
2 answers

CoreData Ambiguous reference to member 'id' Xcode 12

I have a coredata entity with an attribute id of type String when trying to reference that attribute from a key path it throws an error let path = #keyPath(User.id) //Ambiguous reference to member 'id' the codegen is set to Class Definition. I…
zombie
  • 5,069
  • 3
  • 25
  • 54
13
votes
5 answers

how to avoid default method implementation in swagger codegen interface?

I would like to avoid "default" implementation in interface generate by the maven plugin swagger codegen. For example, with petstore swagger : http://petstore.swagger.io/v2/swagger.json I generate interface with maven plugin :
awat
  • 175
  • 1
  • 1
  • 9
10
votes
4 answers

How to append a method to existing class using annotation processing in java / kotlin?

I'm new to annotation processing and code generation. I want to find out how can I perform such operation like appending new method to existing class. Here is an example of what I want to do: Assume that we have a class with with custom annotations…
Andrei Vinogradov
  • 1,865
  • 15
  • 32
10
votes
3 answers

How do I extract the names from a simple function?

I've got this piece of code: import inspect import ast def func(foo): return foo.bar - foo.baz s = inspect.getsource(func) xx = ast.parse(s) class VisitCalls(ast.NodeVisitor): def visit_Name(self, what): if what.id == 'foo': …
Eddy Pronk
  • 6,527
  • 5
  • 33
  • 57
9
votes
1 answer

Generate Fortran subroutine with SymPy codegen for a system of equations

Building on a former example that I've found here, I try to find out how to generate a Fortran code that correspond to a specific form that I need to stick to. The required FORTRAN code will look like this (it is based on the FitzHugh–Nagumo…
Ohm
  • 2,312
  • 4
  • 36
  • 75
9
votes
1 answer

FreeBSD Echoprint codegen

I am trying to compile Echoprint codegen on FreeBSD, but fail. But here's what i get when i try to run make or make install > make "Makefile", line 35: Missing dependency operator "Makefile", line 39: Need an operator "Makefile", line 41: Need an…
Ibolit
  • 9,218
  • 7
  • 52
  • 96
8
votes
1 answer

How to generating TypeScript code with SWC

I'm hoping to use SWC in Rust to generate some TypeScript code. Unfortunately, it seems the emitter can only print JavaScript. Is this correct, or is there a way to print TypeScript? For instance, let's say we're crafting the following AST. use…
8
votes
3 answers

JDK14 can't run "java --add-opens"

I'm doing a small project to learn swagger-codegen. When I'm executing "mvn clean install" the next errors appear: Unable to make public boolean java.util.Collections$EmptyMap.isEmpty() accessible: module java.base does not "opens java.util" to…
kinderproc
  • 198
  • 3
  • 9
8
votes
1 answer

openapi 3.0 valid minimum and maximum values

I have below schema definition to represent commission amount in my openapi contract. commissionAmount: type: number minimum: -99999.99 maximum: 99999.99 Generated Code: @Valid @DecimalMin("-99999.99") @DecimalMax("99999.99") public…
Sridhar
  • 1,832
  • 3
  • 23
  • 44
8
votes
2 answers

Is adaptive parsing possible in Prolog?

I am attempting to write an adaptive parser in Prolog: in other words, a parser that can modify its own parsing rules at runtime. In order to do this, I'll need to generate new predicates at runtime, but I'm not sure if this is possible. Would it be…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
7
votes
1 answer

Xcode 9 build issue with Date vs NSDate for NSManagedObject

Xcode 9 generates different code for Date type attribute of the entity in simulator vs device. I have codegen feature under Class set to category/extension in coredata. Until Xcode 8.3 (latest) it was all working fine (NSDate always). Below is the…
Ashok
  • 6,224
  • 2
  • 37
  • 55
1
2 3
16 17