luckymarmot / Paw-OpenAPI3Importer

OpenAPI 3 (Swagger 3) Importer for Paw
MIT License
18 stars 3 forks source link

Default values are not used in payload #13

Open CharlieBreval opened 2 years ago

CharlieBreval commented 2 years ago

Hello and thank you for your awesome work 👏 ! I come to you because I have spotted an issue on a simple OpenApiSpecification file import.

The file I am trying to import is this one :

  "openapi": "3.0.0",
  "info": {
    "description": "This service is made to get information coming from a restaurant",
    "version": "1.0.0",
    "title": "restaurant-service"
  },
  "servers": [
    {
      "url": "restaurant-service"
    }
  ],
  "paths": {
    "/json-rpc-getRestaurant": {
      "post": {
        "description": "Get a restaurant",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "default": "getRestaurant"
                  },
                  "jsonrpc": {
                    "type": "string",
                    "default": "2.O",
                    "description": "JSON-RPC Version (2.0)"
                  },
                  "id": {
                    "type": "integer",
                    "default": 999
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "default": 1884
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    }
  }
}

Import is successfull, but in the end, default value are not used in the payload As you can see, "method" stays empty as example

Capture d’écran 2021-10-19 à 17 41 31