-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug][typescript] AnyType
is not defined
#6332
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
FYI, I'm working on a fix for this, so I'll present a PR that fixes this situation |
fixed with #6335 |
If the fix already present in the published version? I cannot see any versions after 4.3.1, which has the bug. |
@krajek I think it was published only in v5, which I think it's still in beta! |
If you're able to; try downgrading to |
|
The latest master has this issue resolved. Please try the SNAPSHOT version (mentioned in the README) and let us know if you've any feedback before the official release of v5.0.0 in Dec 2020. |
please can someone explain the fix.i have many problems in openapi like:
|
Sounds like you probably need to go and ask questions on stack overflow... This is a bug report that has been closed. |
Hello!
|
@codeserk Sorry, I was trying to reply to the previous post. |
@davija yeah my comment is also an attempt to reply to @Khaled-Slay 😅 |
Thank you for the reply.
Every time I generate services with openapi .I get those problemes
I manage them by changing Anytype with any.(it seems the generator
produces AnyType instead of any)
replace the basepath with my basepath .but this gets repetitive.
for ModuleWithProvider bug it didn 't stop me from executing my services.
Le lun. 14 déc. 2020 à 23:06, Jose Camara <notifications@github.com> a
écrit :
… @davija <https://github.com/davija> yeah my comment is also an attempt to
reply to @Khaled-Slay <https://github.com/Khaled-Slay> 😅
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6332 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARLQZWQKFEBCGE7KZU4Z673SU2D5XANCNFSM4NDAIB7Q>
.
--
Khaled SLAIMIA
Un ingénieur informatique industrielle
Numero telephone 52278613
|
Hello @Khaled-Slay I'm not sure about the problem with the Hope this helps :) |
Yap that is it.thank you.much appreaciated
…On Tue, 15 Dec 2020, 10:47 Jose Camara, ***@***.***> wrote:
Hello @Khaled-Slay <https://github.com/Khaled-Slay>
I'm not sure about the problem with the basepath, but the problem you
mention about AnyType was the same problem I found when I created this
issue. It should be solved in version 5.x.x, but *not in 4.x.x*
can you check which version are you using? This problem shouldn't be
present in the new version (which I believe it's still in *beta* phase):
https://hub.docker.com/layers/openapitools/openapi-generator-cli/v5.0.0-beta/images/sha256-fdea7c99b45273354b12e4c84b771af1374a35c69eedbe4fe2cc3da8e9018e0f?context=explore
Hope this helps :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6332 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARLQZWSUH74G5Q2E7HDLPKTSU4WDVANCNFSM4NDAIB7Q>
.
|
Hello I am still facing this issue when using the opengenerator version 5.0.0 beta 1-2-3 on the following yaml file : https://github.com/jdegre/5GC_APIs/blob/master/TS29510_Nnrf_NFManagement.yaml (or any) to create python-flask server . Upon running the python -m openapi_server I am greeted with following : Traceback (most recent call last): File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
File "C:\Python39\lib\runpy.py", line 87, in _run_code
File "C:\ \test\openapi_server_main_.py", line 5, in
File "C:\ openapi_server\encoder.py", line 4, in
File "C:\ test\openapi_server\models_init_.py", line 15, in
File "C:\test\openapi_server\models\change_item.py", line 9, in
ModuleNotFoundError: No module named 'openapi_server.models.any_type' I have tried changing the generator version to 4.3.1 as other thread suggested still nothing and tried all of the beta version but still get this error. |
Hello @networkdevCD Not sure if I'm missing something, but looks like you are using a different generator (python). This change only affected the generator for |
Hello @codeserk Your correct apologies was get to end of my tether with it and found this bug report . It seems we also have the same issue in the python generator , was there any quick work around you did the with YAML ? |
Same deal using the gradle plugin |
Bug Report Checklist
Description
AnyType
is not defined in typescript generated code.In some situations, schemas return
any
, this is handled in other languages where that is translated into something the language understands, examples:Java
:Object
C#
: `ObjectRust
:serde_json:Value
However, this translation is not made for
typescript
, and the generators writeAnyType
in such situations, leading to type errors:Cannot find name 'AnyType'
openapi-generator version
5.0.0-SNAPSHOT
OpenAPI declaration file content or url
The part that is causing troubles look like this:
This was generated using @nestjs/swagger and the problem is that the generator is unable to understand the second part and that one ends in
_AnyType_
This is a full example:
output using
typescript-axios
NOTE:
AnyType
is not defined anywhere.Suggest a fix
The proposal is simple, adding a translation for
AnyType
->object
for all thetypescript
generators. This can be achieved adding one line toAbstractTypeScriptCodegen.java
like the ones we have in other generators:The text was updated successfully, but these errors were encountered: