Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values are not used in payload #13

Open
CharlieBreval opened this issue Oct 19, 2021 · 0 comments
Open

Default values are not used in payload #13

CharlieBreval opened this issue Oct 19, 2021 · 0 comments

Comments

@CharlieBreval
Copy link

CharlieBreval commented Oct 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant