diuis opened a new pull request #2: fix for the empty ref attribute of 
RequestBody annotation
URL: https://github.com/apache/geronimo-openapi/pull/2
 
 
   When a jax-rs method parameter is annotated in this way, without the ref 
attribute:
   
   ```
     public AssetViewModel create(@RequestBody(
                                               name = "asset",
                                               description = "request body in 
json format",
                                               content = @Content(
                                                                  mediaType = 
APPLICATION_JSON,
                                                                  schema = 
@Schema(name = "Asset", 
                                                                                
                     implementation = AssetViewModel.class)),
                                                                  required = 
true) final AssetViewModel _asset) {
   
       _log.log(Level.INFO, "Creating {0}", _asset);
   
       return _asset;
     }
   ```
   
   this code:
   `this._ref = _ref.startsWith("#") ? _ref : ("#/components/requestBodies/" + 
_ref);` generates an invalid openapi json:
   
   ```
   "/api/asset":{
         "post":{
           "deprecated":false,
           "description":"api to create a new Asset",
           "operationId":"create",
           "parameters":[
           ],
           "requestBody":{
             "$ref":"#/components/requestBodies/",
   ```
   I think that isn't correct, and swagger-ui complains with the error:
   
   > Resolver error at paths./api/asset.post.requestBody.$ref
   > Could not resolve reference because of: Could not resolve pointer: 
/components/requestBodies/ does not exist in document
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to