marcl's avatar
marcl
Occasional Contributor
9 years ago
Status:
New Idea

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:

 

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

  • ecsmmek's avatar
    ecsmmek
    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.