Comments (12)
@nicolasduminil no, it's just easier to look at an issue if there is a reproducer :) @MikeEdgar I'll leave this to you.
from quarkus.
@phillip-kruger : LOL ! It's even easier not to look at all ...
from quarkus.
/cc @EricWittmann (openapi), @Ladicek (smallrye), @MikeEdgar (openapi), @jmartisk (smallrye), @phillip-kruger (openapi,smallrye), @radcortez (smallrye)
from quarkus.
Can you share your openapi.json or yaml, that gets generated ?
from quarkus.
In addition to what Phillip requested, I suspect you should be using an @RequestBody
annotation rather than an @Parameter
to represent a POST body.
@RequestBody(content = @Content(example = "your example"))
from quarkus.
@phillip-kruger : I'm attaching here the openapi file.
openapi.zip
from quarkus.
@MikeEdgar : using @RequestBody
, as you suggested above, instead of @Parameter
, didn't change anything to the mentioned behavior.
from quarkus.
@nicolasduminil can you share a small reproducer ?
from quarkus.
@phillip-kruger : I will as soon as I'll have the time. But since you need a reproducer, should I understand that you couldn't reproduce the issue by yourself ? I mean, do you confirm that you could test and using the @Parameter
annotation, like in my example, or the @RequestBody
one, like mentioned by @MikeEdgar, you succeeded to get the expected result ? And in this case, which one did you use, @Parameter
or @RequestBody
?
from quarkus.
I was able to get the example in the output using the @RequestBody
annotation. That's the correct annotation for a POST body, although I believe the Swagger annotations use (or did use at one point) the @Parameter
annotation. If you try again with @RequestBody
maybe share here just the method you test and perhaps there is some other adjustment that you need.
from quarkus.
@MikeEdgar : I neglected to mention that, in my case, I have separated the interface and implementation, as follows:
public interface CustomerResource
{
@POST
@Operation(description = "Create a new customer")
@APIResponse(responseCode = "500", description = "An internal server error has occurred", content = @Content(mediaType = APPLICATION_XML))
@APIResponseSchema(value = Customer.class, responseDescription = "The new customer has been created", responseCode = "201")
...
Response createCustomer (Customer customer, @Context UriInfo uriInfo) throws IOException;
}
...
@Path("customers")
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
public class CustomerResourceImpl implements CustomerResource
{
@Override
public Response createCustomer(Customer customer, @Context UriInfo uriInfo) throws IOException
{
...
}
...
}
Does it change anything ? Is that supposed to work as well or is there any obligation to annotate the implementation and not the interface ?
from quarkus.
I neglected to mention that, in my case, I have separated the interface and implementation
Does it change anything ? Is that supposed to work as well or is there any obligation to annotate the implementation and not the interface ?
It should support annotations like you have them. In your code snippet I don't see the @RequestBody
, in which location are you using it?
from quarkus.
Related Issues (20)
- Memory leak on TestContainers IT tests HOT 12
- Investigate SharedOpenArchivePathTree users counting HOT 4
- ArC: add ability to initialize synthetic beans eagerly HOT 3
- Gradle: cannot override the version of a dependency defined in the BOM HOT 2
- Quarkus CLI reports `Unmatched argument at index 2` error when running a command that doesn't exist HOT 1
- Flyway dev UI should allow me to create a migration script HOT 1
- Option `quarkus.log.syslog.max-length` ignores text of the message HOT 2
- Integration tests against AWS deployed services HOT 5
- Kubernetes Job does not inherit customization made to the Kubernetes deployment HOT 5
- Running Quarkus CLI rewrites gradle.properties HOT 1
- Add -DmicroOnly or similar to quarkus:update
- Multipart @FormParam on EntityPart not working according to Jakarta RESTful Web Services 3.1 HOT 3
- Remove @RestClient annotation and handle like normal bean HOT 19
- Scheduler: introduce a build item equivalent of quarkus.scheduler.start-mode=forced HOT 1
- Documentation describing Basic authentication stress additional complexity while this complexity is handled by extensions providing IdentityProvider HOT 6
- Add pagination fields in response or headers for rest-data-panache HOT 1
- HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance HOT 7
- CDI not working with @QuarkusComponentTest HOT 6
- [Extension Proposal] AsyncAPI generator HOT 4
- continous testing - problem with @Nested @Nested: java.nio.file.FileSystemNotFoundException: Provider "quarkus" not installed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus.