Can you file a ticket on the project with the details below?

 

 

 

From: <[email protected]> on behalf of Chris Olson 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Monday, October 2, 2017 at 16:51
To: Swagger <[email protected]>
Subject: RequestBody parameter annotation problem - swagger 2.0.0-RC1

 

I am not seeing the requestBody in the resulting openApi.json. 

 

Below is a method in my java class with gradle swagger dependency: 
io.swagger:swagger-jaxrs2:2.0.0-rc1

 

No matter what I try I don't get the resulting RequestBody structure as 
detailed in the documentation. It's documenting the NewPerson param in the 
parameters array instead. It is interesting that in rc1, the Operation takes a 
RequestBody, but in rc2 they dropped that. Confusing. 

 

The resulting openApi.json:

"post": { 

"parameters": [

{

"schema": {

"$ref": "#/components/schemas/NewPerson"

}

}],

"responses": {

"200": {

"content":

...

}

}

} 

 

 

The code:

import io.swagger.oas.annotations.Operation;

import io.swagger.oas.annotations.media.Content;

import io.swagger.oas.annotations.media.Schema;

import io.swagger.oas.annotations.parameters.RequestBody;

import io.swagger.oas.annotations.responses.ApiResponse;

 

 @POST 

 @Produces({MediaType.APPLICATION_JSON})

 @Consumes(MediaType.APPLICATION_JSON)  

 @Operation()

    public Response post(        

        @RequestBody(description = "New Person", required = true, content = 
@Content(mediaType = MediaType.APPLICATION_JSON, schema = 
@Schema(implementation = NewPerson.class)))  NewPerson np

    )

    {}

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to