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
As for the mock file, neither parameters nor headers are applied, making it difficult to test using the mock server. After reviewing all issues and PRs, I was surprised to find no questions or discussions about this. Is there something that I'm overlooking?
However, the current example seems exactly the same. herehere2 here3
If the implementation is correct now, how should we go about using the mock server? I am specifically interested in using limit, offset, or error mock handlers, among other features.
I'm currently confused and could use your help and guidance.
petstore.yaml
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/Pets'default:
description: unexpected errorcontent:
application/json:
schema:
$ref: '#/components/schemas/Error'post:
summary: Create a petoperationId: createPetstags:
- petsrequestBody:
required: truecontent:
application/json:
schema:
type: objectrequired:
- 'name'
- 'tag'properties:
name:
type: stringtag:
type: stringresponses:
'201':
description: Null responsedefault:
description: unexpected errorcontent:
application/json:
schema:
$ref: '#/components/schemas/Error'/pets/{petId}:
get:
summary: Info for a specific petoperationId: showPetByIdtags:
- petsparameters:
- name: petIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: string
- name: testIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: stringresponses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: '#/components/schemas/Pet'default:
description: unexpected errorcontent:
application/json:
schema:
$ref: '#/components/schemas/Error'components:
schemas:
Pet:
type: objectrequired:
- id
- nameproperties:
id:
type: integerformat: int64name:
type: stringtag:
type: stringPets:
type: arrayitems:
$ref: '#/components/schemas/Pet'Error:
type: objectrequired:
- code
- messageproperties:
code:
type: integerformat: int32message:
type: string
/pets
parameters:
- name: limitin: querydescription: How many items to return at one time (max 100)required: falseschema:
type: string
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As for the mock file, neither parameters nor headers are applied, making it difficult to test using the mock server. After reviewing all issues and PRs, I was surprised to find no questions or discussions about this. Is there something that I'm overlooking?
However, the current example seems exactly the same.
here here2
here3
If the implementation is correct now, how should we go about using the mock server? I am specifically interested in using limit, offset, or error mock handlers, among other features.
I'm currently confused and could use your help and guidance.
petstore.yaml
/pets
orval.config.ts
petstoreFromFileSpecWithTransformer.ts
petstoreFromFileSpecWithTransformer.msw.ts
Why is the argument all of the function blank?
Beta Was this translation helpful? Give feedback.
All reactions