You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to create a cumulative fix for missing Object.h, AnyType.h, Set.h for many generators: can you give me some knowledge you have to help me correcting them?
#18523
Open
mlebihan opened this issue
Apr 28, 2024
· 2 comments
Many generators encounter the same problem against properties having a "type": "object" or 'type": ["string", "number",...], and another form with arrays that lead to missing sources files at generation time:
Object.h
AnyType.h
Set.h
being declared as #include but no Object.h, Object.cpp, AnyType.h, AnyType.cpp, Set.h, Set.cpp [for C++ example], are generated aside.
I am in need of correcting this problem, and I would like to solve it for the most generators possible. All, if possible.
They are already a lot of issues created for this trouble: one for one specific generator each time. But I think it's useful to gather here all the knowledge we have about it.
I begin focusing on it, and here's what I've attempted in a fork branch, to create a test that fails for the first of these problems:
veterinarianVisit:
type: objectdescription: last veterinarian visit advice
Debugging things, it looks that C generator does generates its object.h and object.c files:
But cpp-pistache generator doesn't generate its equivalent Object.h and Object.cpp:
[main] ERROR org.openapitools.codegen.ObjectAnyTypeSetTest - Object.h expected file hasn't been produced by cpp-pistache-server generator.
[main] ERROR org.openapitools.codegen.ObjectAnyTypeSetTest - Object.cpp expected file hasn't been produced by cpp-pistache-server generator.
java.lang.AssertionError: 2 files ([Object.cpp, Object.h]) are lacking in cpp-pistache-server generation
Expected :true
Actual :false
<Click to see difference>
at org.testng.Assert.fail(Assert.java:110)
at org.testng.Assert.failNotEquals(Assert.java:1413)
at org.testng.Assert.assertTrue(Assert.java:56)
at org.openapitools.codegen.ObjectAnyTypeSetTest.assertGeneratedFiles(ObjectAnyTypeSetTest.java:72)
at org.openapitools.codegen.ObjectAnyTypeSetTest.testSomeWithPetstoreWithAbstract(ObjectAnyTypeSetTest.java:45)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.testng.TestRunner.privateRun(TestRunner.java:808)
at org.testng.TestRunner.run(TestRunner.java:603)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:429)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:423)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:383)
at org.testng.SuiteRunner.run(SuiteRunner.java:326)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1249)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.runSuites(TestNG.java:1092)
at org.testng.TestNG.run(TestNG.java:1060)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Depending on the issues I've read about this, they are various advices. Can you tell me:
If once, these sources were generated but an event (around 4.1.0 version of openapi generator? earlier?) made that it doesn't work anymore?
If it's just a configuration issue : the missing sources exist (for each generator) but they just aren't "pushed" at generation time, for any reason ; or if at the opposite, they are entirely missing? "We don't know yet (we haven't written yet), in example, how to perform a C++ serialization in json of an Object?
What do you recommend me, to solve this problem?
Thanks!
The text was updated successfully, but these errors were encountered:
mlebihan
changed the title
Attempt to create a cumulative fix for missing Object.h, AnyType.h, Set.h for many generators: can you give me all the knowledge you have about how to correct them?
Attempt to create a cumulative fix for missing Object.h, AnyType.h, Set.h for many generators: can you give me some knowledge you have to help me correcting them?
Apr 28, 2024
Many generators encounter the same problem against properties having a
"type": "object"
or'type": ["string", "number",...]
, and another form with arrays that lead to missing sources files at generation time:being declared as
#include
but noObject.h
,Object.cpp
,AnyType.h
,AnyType.cpp
,Set.h
,Set.cpp
[for C++ example], are generated aside.I am in need of correcting this problem, and I would like to solve it for the most generators possible. All, if possible.
They are already a lot of issues created for this trouble: one for one specific generator each time. But I think it's useful to gather here all the knowledge we have about it.
I begin focusing on it, and here's what I've attempted in a fork branch, to create a test that fails for the first of these problems:
master...mlebihan:openapi-generator:any_type
and I generate from a custom petstore, where I've added to
Pet
definition a:Debugging things, it looks that
C
generator does generates itsobject.h
andobject.c
files:But
cpp-pistache
generator doesn't generate its equivalentObject.h
andObject.cpp
:Depending on the issues I've read about this, they are various advices. Can you tell me:
If once, these sources were generated but an event (around
4.1.0
version of openapi generator? earlier?) made that it doesn't work anymore?If it's just a configuration issue : the missing sources exist (for each generator) but they just aren't "pushed" at generation time, for any reason ; or if at the opposite, they are entirely missing? "We don't know yet (we haven't written yet), in example, how to perform a C++ serialization in json of an Object?
What do you recommend me, to solve this problem?
Thanks!
The text was updated successfully, but these errors were encountered: