swagger-api/swagger-codegen

[Question] Can I define the response-example

Open

#3,907 建立於 2016年9月30日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)HTML (5,474 fork)batch import
Enhancement: FeatureGeneral: Questionhelp wanted

倉庫指標

Star
 (12,701 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Description

Can I define the response-example in swagger.json, and use codeGen to mock the request and the response.As example: I define the result of the api [GET]/pet/{petId}, and the pet's name is "xiaoming" of the invoke result.I hope to get the result as this: {name:"xiaoming"}. Also ,I hope to get the result as {name: "xiaohong"} when I define the pet's name as "xiaohong". Is there any feature like this in swagger-editor or codegen? Thank you for your reply very much!!!

Swagger-codegen version
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues
Suggest a Fix

貢獻者指南