cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger: use body model when importing

Swagger: use body model when importing

When importing a swagger file which contains some body model, it would be good if R!API could use it to generate the corresponding REST request.

 

Basically, let's say I have a swagger "operation" with the following:

apis": [
    {
        "path": "/example",
        "operations": [
            {
                "method": "POST",
                "nickname": "handlePost",
                "produces": [
                    "application/json"
                ],
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "data",
                        "paramType": "body",
                        "type": "InsertionData"
                    }
                ],

And the InsertionData model defined like that:

 

models": {
    "InsertionData": {
        "id": "InsertionData",
        "properties": {
            "id": {
                "type": "integer",
                "format": "int64",
                "required": "true"
            },
            "address": {
                "type": "integer",
                "format": "int32",
                "required": "true"
            }
        }
    }
}

 

 

When I import this using Swagger, R!API will create a blank POST request with an empty body:

rest_import_example1.png

 

I would expect it to create a default body like this to the request instead:

rest_import_example2.png

1 Comment
Occasional Contributor

We are in a project we're we using REST based on OpenAPI 3.0 definitions and we're wondering if there has been some progress in the area described in the new feature request post above?

It would be most appreciated if ReadyAPI would be equipped with this functionality.

Announcements
Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Join us and watch the welcome video:
Announcements