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
6
votes
2 answers

GraphQL: POST body missing, invalid Content-Type, or JSON object has no keys

I am trying to create a mutation but I keep getting a POST body is missing. I can log the data before urql and codegen hooks are called and I can see the data in the variables on the error, but chrome keeps imploding with a "POST body missing" error…
AndrogenAgonist
  • 244
  • 1
  • 3
  • 13
6
votes
3 answers

How do I write slick table definitions with nullable columns?

This table definition worked until I realized that having nullable columns meant that I needed to use Option[String] instead of just String. That was the only change I made and this is what my code looks like now. class RespondentTableDef(tag: Tag)…
B Roy Dawson
  • 611
  • 1
  • 6
  • 18
6
votes
1 answer

Generating annotations using JavaPoet

I am writing a code generator using JavaPoet and need to put an annotation on the class For example : package some.package import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.Entity; import…
nvalada
  • 265
  • 1
  • 11
6
votes
1 answer

Swagger-codegen get started

I'm looking to get into Swagger, more specifically, the swagger-codegen tool. I find the provided information, documentation and specs in both github and http://swagger.io/ to be rather confusing (plus, some links to code examples were broken…
user2403149
5
votes
3 answers

Generate C code with Sympy. Replace Pow(x,2) by x*x

I am generating C code with sympy the using the Common Subexpression Elimination (CSE) routine and the ccode printer. However, I would like to have powered expressions as (x*x) instead of pow(x,2). Anyway to do this? Example: import sympy as sp a=…
Manuel Oliveira
  • 527
  • 5
  • 19
5
votes
2 answers

OPENAPI/Swagger codegen AdditionnalProperties extends HashMap : play(jackson) deserialization failure.

My problem is a little bit complicated, I'll try to explain it clearly. To do it, I've done a simple project. I'm using Swagger codegen to generate Java classes from swagger file. In the swagger file, a definition is using additionnalProperties. …
user3560649
  • 91
  • 2
  • 3
5
votes
3 answers

Swagger codegen ignore null fields for POJO classes

I'm making a REST API and I would like to add at the class generation the Jackson annotation to ignore null fields, so I would like to add this annotation onfly for certain classes, not for the hole project. I know that this could be acomplished by…
Florin Lei
  • 521
  • 8
  • 16
5
votes
1 answer

How to make Xcode core data code generated files to be public accessed

I am a bit confused with new codegen functionality. While developing, you could lookup all files that exist in projects. But not with codegen. However, it worked well. But it doesn't fit new framework-oriented programming paradigm. Scenario: I have…
gaussblurinc
  • 3,642
  • 9
  • 35
  • 64
5
votes
3 answers

Is it possible to customize Slick code generation to have generated classes extend custom traits?

I'm currently using Slick codegen (version 3.2.0-M1) to generate Slick code for a database. Many of my tables contain the same columns (with the same name and type), and so I would like to have some methods that can perform operations on these…
Jeremy K
  • 81
  • 4
5
votes
2 answers

How to use sympy codegen with expressions that contain implemented functions

Im trying to compile an expression that contains an UndefinedFunction which has an implementation provided. (Alternatively: an expression which contains a Symbol which represents a call to an external numerical function) Is there a way to do this?…
PeterE
  • 5,715
  • 5
  • 29
  • 51
5
votes
1 answer

Visual Studio code generation - Use uppercase type names

I prefer to use actual type names for primitive types instead of their corresponding keywords, such as String instead of string, Int32 instead of int, etc., because I like to have consistent syntax highlight and casing - that is, typenames are…
Balázs
  • 2,929
  • 2
  • 19
  • 34
4
votes
1 answer

Why do gcc and clang generate so much code for std::find?

I entered the following code into godbolt.org, and compiled it with gcc 10.1 and clang 10: #include #include typedef std::vector V; template InputIt myfind(InputIt first, InputIt last, const T&…
4
votes
1 answer

jOOQ Converter expression for single column in table

I have a custom EnumConverter setup and I want to use it only for a single column in a specific table to generate the POJOs. foo.bar.MyTableStatus mytable.status I've tried…
Eldelshell
  • 6,683
  • 7
  • 44
  • 63
4
votes
2 answers

MATLAB to C-code

I am following MathWorks guide to converting MATLAB code to C-code. The first step is to enter %#codegen after every function that I want converted to C-code, however doing so has given me the following prompt on the code below. function…
user3084048
  • 41
  • 1
  • 3
4
votes
2 answers

OOP Matlab inheritance issue with Matlab coder (Simulink MATLAB Function block)

I have defined an abstract base class measurementHandler < handle which defines the interface for all inherited classes. Two subclasses of this class are a < measurementHandler and b < measurementHandler. I now have a function which should return a…
1
2
3
16 17