0

我正在 python 中构建一个 Flasgger/Swagger API。当我将值输入参数并执行代码时,我看到以下错误。我还分享了异常图像。

"""Example endpoint returning a list of colors by value
    This is using docstrings for specifications.
    ---
    tags:
      - Iris Prediction API Input values
    parameters:
      - name: s_length
        in: path
        type: string
        required: true
        default:
      - name: s_width
        in: path
        type: string
        required: true
        default:
      - name: p_length
        in: path
        type: string
        required: true
        default:
      - name: p_width
        in: path
        type: string
        required: true
        default:
    definitions:
      value:
        type: object
        properties:
          value_name:
            type: string
            items:
              $ref: '#/definitions/Color'
      Color:
        type: string
    responses:
      200:
        value: prediction details
        schema:
          $ref: '#/definitions/value'
        examples:
          rgb: ['red', 'green', 'blue']
"""

ValueError:输入包含 NaN、无穷大或对于 dtype('float32') 来说太大的值

Flasgger 本地主机图像 异常图像

4

1 回答 1

0

我能够通过更改这些参数来弄清楚。

        in: query
        type: integer
于 2018-07-22T17:45:11.523 回答