swagger-api/swagger-codegen

[Question] Can I define the response-example

Open

#3.907 aberto em 30 de set. de 2016

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)HTML (5.474 forks)batch import
Enhancement: FeatureGeneral: Questionhelp wanted

Métricas do repositório

Stars
 (12.701 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador