You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an openapi spec with 400 or 500 responses e.g.
openapi: '3.0.0'info:
version: 1.0.0title: Swagger Petstorelicense:
name: MITservers:
- url: http://petstore.swagger.io/v1paths:
/pets:
get:
summary: List all petsoperationId: listPetstags:
- petsparameters:
- name: limitin: querydescription: How many items to return at one time (max 100)required: falseschema:
type: stringresponses:
'200':
description: A paged array of petsheaders:
x-next:
description: A link to the next page of responsesschema:
type: stringcontent:
application/json:
schema:
$ref: '#/components/schemas/Labradoodle''201':
description: A paged array of petsheaders:
x-next:
description: A link to the next page of responsesschema:
type: stringcontent:
application/json:
schema:
$ref: '#/components/schemas/Dachshund''400':
description: A paged array of petsheaders:
x-next:
description: A link to the next page of responsesschema:
type: stringcontent:
application/json:
schema:
$ref: '#/components/schemas/Cat'default:
description: unexpected errorcontent:
application/json:
schema:
$ref: '#/components/schemas/Error'components:
schemas:
Labradoodle:
type: objectrequired: ['cuteness']properties:
cuteness:
type: integerDachshund:
type: objectrequired: ['length']properties:
length:
type: integerCat:
type: objectrequired: ['type']properties:
petsRequested:
type: integertype:
type: stringenum:
- catError:
type: objectrequired:
- code
- messageproperties:
code:
type: integerformat: int32message:
type: string
Generate mocks using orval
What happens?
Orval only generates an http response with a 200 status (which picks from an array of all 2xx so these can't be used independently) and does not generate any code for error responses:
What are the steps to reproduce this issue?
What happens?
Orval only generates an http response with a 200 status (which picks from an array of all 2xx so these can't be used independently) and does not generate any code for error responses:
What were you expecting to happen?
Mocks for all responses to be generated so that each response can be tested.
Any logs, error output, etc?
…
Any other comments?
…
What versions are you using?
Operating System: …
Package Version: …
Browser Version: …
The text was updated successfully, but these errors were encountered: