-
Notifications
You must be signed in to change notification settings - Fork 94
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
Inexistent 200 response mapped to null appears #1700
Comments
@dfernandezm ping |
Ok,If you still have a problem, update the example and write about it - we will reopen the ticket |
Hi, sorry for late reply @altro3, I've been away. Thanks for trying to recreate this, all it's a bit confusing but I still get the error my side. It can be environmental, I'll try to add more detail. I amended the spec to have a minimal failing one and validated it with Swagger editor too. This is the
The spec I'm using:
Codegen seems to work, but
Codegen seems to work well (I can see apis and models) but compileJava task is throwing this obscure exception. Any guidance is appreciated |
@dfernandezm Hm.. I still can't reproduce this bug. Could you create a sample application to reproduce this bug? The current information is not enough, because I can't reproduce your problem. Also, try using the latest version of micronaut-openapi . Right now you are using a very old version 6.11.1 |
Unlikely, but possible: you're on a Mac and I'm on Windows, so it works for me and not for you. It's extremely important that you create a complete, simple application to reproduce the problem. |
Hi, thanks for the time again. I've put 6.11.1 and still get the issue. The problem happens after code generation, and it's a gradle exception. It's likely I need to park this for a bit, but I'll attach a minimal application that reproduces the problem at the earliest. |
@dfernandezm Once again:
I can't help you any other way. |
HI @altro3 I finally found the issue. The clue was something about annotation processing in the exception. Basically I had a controller like this:
Before codegen , I was generating the spec from the code annotations (as it helps reason about outputs etc.). Now I use the base spec to do spec-first and iterate on it. I don't think it's common at all gen code from spec and also have controllers annotated, so this issue won't happen to 99.9% of people. I can create a reproducer easily, but I wonder of its value given the extreme edge case. The error is very misleading though. Thanks for the help! |
Of course it is valuable because somehow you managed to add |
To manage expectations, it might take some time for me to generate this reproducer, as I need to progress with the project. But I will definitely do it so please leave the issue opened. On a separate topic (can post question?) I find it hard to find docs on the basics of codegen from spec. I have a strong use case to generate server Micronaut from spec and I'm struggling to find many of the settings/features as seen at https://openapi-generator.tech/, I see that the Micronaut codegen moved to this project so I would've expected same features here? (for example |
That's right, the generator was moved here. So, regarding the settings that are supported, unfortunately, no one has written normal documentation for code generation. But here you can find all the settings that can be set at the moment: |
Thanks for the core info. Checking what's there, unfortunately I'll be stuck with OpenAPI generator core plugin with custom templates for a while then, as I need to heavily customise the models mainly (add extra annotations etc.) and don't see a way to override templates or use more configOptions that currently supported in the moved Micronaut Server generator (I'll keep an eye for updates though). Regardless I'll provide the reproducer for the original issue as soon as I can, but with low priority as I need to make progress proving codegen / spec-first for this project. |
If you see that there are some features that are supported in the main openapi generator, but they are not supported in the generator from micronaut - just create an issue. I add features as requests come in. |
@dfernandezm Please write in a separate issue a list of features that you need and that are not currently available - I will add them in the very near future. |
@dfernandezm added support for additional annotations here: #1771 |
@dfernandezm any news? |
Expected Behavior
Using micronaut openapi 6.11.1
Code to generate from spec correctly
Actual Behaviour
NullPointerException when generating POST request
Steps To Reproduce
Environment Information
Example Application
No response
Version
4.5.0
The text was updated successfully, but these errors were encountered: