Skip to content

Default values are not used in payload #13

@CharlieBreval

Description

@CharlieBreval

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions