Error in mockserver with query param when uses $ref
See original GitHub issueWhen you want to create a mockserver with multiple examples based on a query param. If the query param is a $ ref it doesn’t work correctly.
Example good: / resources:
get:
tags: [examples]
summary: Get resources by query
description: Get a list of resources by query
operationId: queryOp
parameters:
- name: resourceType
in: query
description: Get a list of resources by type
schema:
type: string
enum: [standard, premium]
examples:
standard_example:
value: 'standard'
premium_example:
value: 'premium'
responses:
'200':
description: List of resources
content:
application / json:
schema:
properties:
yam:
type: string
resourceType:
type: string
enum: [standard, premium]
examples:
standard_example:
value:
- name: 'Resource One'
resourceType: 'standard'
premium_example:
value:
- name: 'Resource Two'
resourceType: 'premium'
all_example:
value:
- name: 'Resource One'
resourceType: 'standard'
- name: 'Resource Two'
resourceType: 'premium'
Example bad: / resources:
get:
tags: [examples]
summary: Get resources by query
description: Get a list of resources by query
operationId: queryOp
parameters:
- $ ref: '# / components / parameters / resourceTypeQueryParam'
responses:
'200':
description: List of resources
content:
application / json:
schema:
properties:
yam:
type: string
resourceType:
type: string
enum: [standard, premium]
examples:
standard_example:
value:
- name: 'Resource One'
resourceType: 'standard'
premium_example:
value:
- name: 'Resource Two'
resourceType: 'premium'
all_example:
value:
- name: 'Resource One'
resourceType: 'standard'
- name: 'Resource Two'
resourceType: 'premium'
Thanks for all.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Creating Expectations - MockServer
A request properties matcher matches requests using one or more of the following properties: method - property matcher; path - property matcher; path...
Read more >java - MockRestServiceServer how to verify only request path ...
In the test method I want to verify that the correct endpoint path and query params (name particularly) are used in API call....
Read more >jamesdbloom/mockserver - Gitter
I'm looking for a way using which I can define 2 expectations, one with Query parameters and other without it (for same Method...
Read more >Mocking - Apollo GraphQL Docs
Mock your GraphQL data based on a schema. ... New in Apollo Server 4: Apollo Server 4 removes both the mocks and mockEntireSchema...
Read more >Interface Mockttp
const mockServer = require('mockttp'). ... Call .start() to set up a server on a random port, use . ... url. url: string. Defined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi lbroudoux,
I’will provide you a complete example:
Check in the resource accounts please, uri_params not works correctly
Thanks for all
It should be available now in latest container image. It will be included into 1.3.0 release I hope on next week.