0

I am creating API by Swagger 2.0. Everything is good on Swagger 2.0, but, when build it to Slate, all the example value is not shown, just show the data type.

Ex. In swagger, what I want is:

{
 "cd": 0,
 "data": {
   "Num1": "113.90083333",
   "Num2": "113.5991"
  }
}

But in Slate interface after being built,

{
"cd": "string",
"data": {
    "Num1": "number",
    "Num2": "number"
}
}

YAML code:

/mar:
get:
  tags:
  - MP
  operationId: "MP1"
  produces: 
  - application/json
  responses:
    200:
      description: "WELL"
      schema:
          type: object
          properties:
            cd:
              type: string
              example: 0
            data:
              type: object
              properties:
                Num1:
                  type: number
                  example: "113.90083333"
                Num2:
                  type: number
                  example: "113.5991"
Pae
  • 11
  • 3
  • Can you post your Swagger YAML/JSON file? – Helen Jun 25 '18 at 07:42
  • I have added YAML code by editing the question! – Pae Jun 25 '18 at 13:27
  • Not sure if this is related to your issue, but the property types in your spec do not match the "what I want" example - e.g. you want `cd` as integer, but in the spec it's `type: string` instead of `type: integer`. Similarly, you want `Num1` and `Num2` as strings, but in the spec they are `type: number` instead of `type: string`. – Helen Jun 26 '18 at 13:54

0 Answers0