最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Flasgger schema definition doesn't show in swagger-ui when using openapi 3.0.2 - Stack Overflow

programmeradmin7浏览0评论

I have an endpoint defined as such:

def process_document():
    """
    Process document
    ---
    definitions:
        JobSubmissionResponse:
            type: object
            properties:
                job_id:
                    type: string
                    description: Job ID
    responses:
        500:
            description: Fatal Error Occurred
        200:
            description: Job submitted successfully
            schema:
                type: object
                properties:
                    job_id:
                        type: string
                        description: Job ID
    """
    job_id = uuid.uuid4()
    return jsonify({
        "job_id": job_id,
    })

When I use Open API 3.0.2, as such:


app.config['SWAGGER'] = {
    'title': 'MyApp',
    'openapi': '3.0.2'
}

The Swagger-UI does not display the schema within the return type:

If I do not specify OpenAPI 3.0.2, it works fine:

Was that method of referencing a schema deprecated in OpenAPI 3.0.2?

thank you

发布评论

评论列表(0)

  1. 暂无评论