我正在 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') 来说太大的值