Giter Club home page Giter Club logo

Comments (8)

medaoutir avatar medaoutir commented on September 22, 2024 1

Thanks a lot @outofcoffee,
Now It's worked as expected; I have updated the config file as below by setting the basePath to "/api":

plugin: openapi
specFile: swagger_accounts.yaml
isPickFirstIfNoneMatch: false
basePath: /api

resources:
  - path: "/deposits:search"
    method: POST
    queryParams:
      detailsLevel: FULL
    requestHeaders:
      Content-Type: application/json
    requestBody:
      allOf:
        - jsonPath: $.filterCriteria[0].field
          value: _Card_Deposit_Accounts.ACCOUNT_CARD_ID
        - jsonPath: $.filterCriteria[0].operator
          value: EQUALS
        - jsonPath: $.filterCriteria[0].value
          value: 22578490
    response:
      exampleName: accountExtendedCreated

  - path: "/deposits:search"
    method: POST
    queryParams:
      detailsLevel: FULL
    requestBody:
      allOf:
        - jsonPath: $.filterCriteria[0].field
          value: _Card_Deposit_Accounts.ACCOUNT_CARD_ID
        - jsonPath: $.filterCriteria[0].operator
          value: EQUALS
        - jsonPath: $.filterCriteria[0].value
          value: 33689503
    response:
      exampleName: accountExtendedCreatedWhenBlocking

Thanks again 👍 I will close the issue.

from imposter.

outofcoffee avatar outofcoffee commented on September 22, 2024 1

Thank you very much for the detailed report! We will need to update the docs to recommend that the basePath should be aligned in the OpenAPI plugin.

from imposter.

medaoutir avatar medaoutir commented on September 22, 2024

Hi @outofcoffee have you a time slot to resolve my issue please ?

from imposter.

outofcoffee avatar outofcoffee commented on September 22, 2024

Hi @medaoutir, thanks very much for raising this.

There is a bug prior to v3.28.1 that would cause incorrect matching behaviour on the request body. This was especially pronounced when using the allOf or anyOf clauses.

I hope this helps. Please could you let us know if this fixes the issue?


On a related note, you can set this option to disable the fallback when there are multiple candidate matches:

pickFirstIfNoneMatch: false

See log entry:

2023-08-06 14:02:45 13:02:45 DEBUG i.g.i.p.o.s.ExampleServiceImpl - No exact match found for accepted content types - choosing first item found (application/json) from specification. You can switch off this behaviour by setting configuration option 'pickFirstIfNoneMatch: false'

from imposter.

medaoutir avatar medaoutir commented on September 22, 2024

Thanks for your answer @outofcoffee but The same error still occurs, always the mockserver render the first example as described in my first issue, but I think that the scoring algorithm has changed.
Just notice that I have completly removed the image and rebuild it to get the v3.28.1 that brings your correction.
Below the imposter log:

2023-08-07 14:27:36 13:27:36 TRACE i.v.e.w.i.RouterImpl - Router: 30400646 accepting request POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.v.e.w.RoutingContext - Route matches: RouteState{metadata=null, path='null', name=null, order=1, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.gatehill.imposter.server.vertxweb.VertxWebServerFactoryImpl$$Lambda$446/0x0000000840687840@4281acf8], failureHandlers=null, added=true, pattern=null, groups=null, useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true}
2023-08-07 14:27:36 13:27:36 TRACE i.v.e.w.RoutingContext - Calling the handler
2023-08-07 14:27:36 13:27:36 TRACE i.v.e.w.RoutingContext - Route matches: RouteState{metadata=null, path='/api/deposits:search', name=null, order=23, enabled=true, methods=[POST], consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.gatehill.imposter.server.vertxweb.VertxWebServerFactoryImpl$$Lambda$446/0x0000000840687840@60d03fa1], failureHandlers=null, added=true, pattern=/api/deposits(?[^/]+)/?, groups=[search], useNormalizedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=true}
2023-08-07 14:27:36 13:27:36 TRACE i.v.e.w.RoutingContext - Calling the handler
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Matching against all of 3 request body configs for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL: [BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].field, xPath=null, xmlNamespaces=null, value=_Card_Deposit_Accounts.ACCOUNT_CARD_ID, operator=null), BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].operator, xPath=null, xmlNamespaces=null, value=EQUALS, operator=null), BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].value, xPath=null, xmlNamespaces=null, value=22578490, operator=null)]
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo '_Card_Deposit_Accounts.ACCOUNT_CARD_ID': ResourceMatchResult(type=EXACT_MATCH, weight=1)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo 'EQUALS': ResourceMatchResult(type=EXACT_MATCH, weight=1)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo '22578490': ResourceMatchResult(type=NOT_MATCHED, weight=0)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Request match evaluation for '[86cdf404-6284-4a9a-8ab8-0dc1ddeb647c] POST http://localhost:8090/api/deposits:search?detailsLevel=FULL' to resource OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits:search, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreated)), method=POST, pathParams=null, queryParams={detailsLevel=FULL}, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=BaseRequestBodyConfig(jsonPath=null, xPath=null, xmlNamespaces=null, value=null, operator=null), eval=null, passthrough=null), path=/deposits:search, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreated)), from results: [ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NO_CONFIG, weight=1)], outcome: MatchedResource(resource=ResolvedResourceConfig(config=OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits:search, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreated)), method=POST, pathParams=null, queryParams={detailsLevel=FULL}, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=BaseRequestBodyConfig(jsonPath=null, xPath=null, xmlNamespaces=null, value=null, operator=null), eval=null, passthrough=null), path=/deposits:search, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreated)), pathParams={}, queryParams={detailsLevel=FULL}, formParams={}, requestHeaders={Content-Type=application/json}), matched=false, score=3, exact=false)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Matching against all of 3 request body configs for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL: [BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].field, xPath=null, xmlNamespaces=null, value=_Card_Deposit_Accounts.ACCOUNT_CARD_ID, operator=null), BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].operator, xPath=null, xmlNamespaces=null, value=EQUALS, operator=null), BaseRequestBodyConfig(jsonPath=$.filterCriteria[0].value, xPath=null, xmlNamespaces=null, value=33689503, operator=null)]
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo '_Card_Deposit_Accounts.ACCOUNT_CARD_ID': ResourceMatchResult(type=EXACT_MATCH, weight=1)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo 'EQUALS': ResourceMatchResult(type=EXACT_MATCH, weight=1)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Body match result for EqualTo '33689503': ResourceMatchResult(type=EXACT_MATCH, weight=1)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Request match evaluation for '[86cdf404-6284-4a9a-8ab8-0dc1ddeb647c] POST http://localhost:8090/api/deposits:search?detailsLevel=FULL' to resource OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits:search, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreatedWhenBlocking)), method=POST, pathParams=null, queryParams={detailsLevel=FULL}, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=BaseRequestBodyConfig(jsonPath=null, xPath=null, xmlNamespaces=null, value=null, operator=null), eval=null, passthrough=null), path=/deposits:search, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreatedWhenBlocking)), from results: [ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=3), ResourceMatchResult(type=NO_CONFIG, weight=1)], outcome: MatchedResource(resource=ResolvedResourceConfig(config=OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits:search, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreatedWhenBlocking)), method=POST, pathParams=null, queryParams={detailsLevel=FULL}, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=BaseRequestBodyConfig(jsonPath=null, xPath=null, xmlNamespaces=null, value=null, operator=null), eval=null, passthrough=null), path=/deposits:search, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=null, headers=null, performanceDelay=null, failureType=null), exampleName=accountExtendedCreatedWhenBlocking)), pathParams={}, queryParams={detailsLevel=FULL}, formParams={}, requestHeaders={Content-Type=application/json}), matched=false, score=6, exact=false)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - No request body config to match for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Request match evaluation for '[86cdf404-6284-4a9a-8ab8-0dc1ddeb647c] POST http://localhost:8090/api/deposits:search?detailsLevel=FULL' to resource OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits/:depositAccountId, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=204, headers=null, performanceDelay=null, failureType=null), exampleName=null)), method=PATCH, pathParams={depositAccountId=5b853e007ba05e8a017acac995d34029}, queryParams=null, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=null, eval=null, passthrough=null), path=/deposits/:depositAccountId, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=204, headers=null, performanceDelay=null, failureType=null), exampleName=null)), from results: [ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1)], outcome: MatchedResource(resource=ResolvedResourceConfig(config=OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits/:depositAccountId, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=204, headers=null, performanceDelay=null, failureType=null), exampleName=null)), method=PATCH, pathParams={depositAccountId=5b853e007ba05e8a017acac995d34029}, queryParams=null, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=null, eval=null, passthrough=null), path=/deposits/:depositAccountId, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=204, headers=null, performanceDelay=null, failureType=null), exampleName=null)), pathParams={depositAccountId=5b853e007ba05e8a017acac995d34029}, queryParams={}, formParams={}, requestHeaders={Content-Type=application/json}), matched=false, score=1, exact=false)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - No request body config to match for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - Request match evaluation for '[86cdf404-6284-4a9a-8ab8-0dc1ddeb647c] POST http://localhost:8090/api/deposits:search?detailsLevel=FULL' to resource OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits/:depositAccountId, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=400, headers=null, performanceDelay=null, failureType=null), exampleName=null)), method=PATCH, pathParams={depositAccountId=5b853e007ba05e8a017acac995d34030}, queryParams=null, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=null, eval=null, passthrough=null), path=/deposits/:depositAccountId, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=400, headers=null, performanceDelay=null, failureType=null), exampleName=null)), from results: [ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NOT_MATCHED, weight=0), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=EXACT_MATCH, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1), ResourceMatchResult(type=NO_CONFIG, weight=1)], outcome: MatchedResource(resource=ResolvedResourceConfig(config=OpenApiResourceConfig(parent=RestResourceConfig(parent=AbstractResourceConfig(path=/deposits/:depositAccountId, securityConfig=null, captureConfig=null, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=400, headers=null, performanceDelay=null, failureType=null), exampleName=null)), method=PATCH, pathParams={depositAccountId=5b853e007ba05e8a017acac995d34030}, queryParams=null, formParams=null, requestHeaders={Content-Type=application/json}, requestBody=null, eval=null, passthrough=null), path=/deposits/:depositAccountId, responseConfig=OpenApiResponseConfig(parent=ResponseConfig(file=null, content=null, dir=null, isTemplate=null, scriptFile=null, statusCode=400, headers=null, performanceDelay=null, failureType=null), exampleName=null)), pathParams={depositAccountId=5b853e007ba05e8a017acac995d34030}, queryParams={}, formParams={}, requestHeaders={Content-Type=application/json}), matched=false, score=1, exact=false)
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.h.AbstractResourceMatcher - No matching resource config for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.s.s.SecurityLifecycleListenerImpl - No security policy found for: POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.p.o.OpenApiPluginImpl - Operation search matched for request: POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 DEBUG i.g.i.p.o.s.SpecificationServiceImpl - Validation passed for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.s.ResponseRoutingServiceImpl - 0 processing steps for request: POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.s.ResponseRoutingServiceImpl - Using default HTTP 201 response behaviour for request: POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 DEBUG i.g.i.p.o.OpenApiPluginImpl - Setting content type [application/json] from specification for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.s.ResponseServiceImpl - Sending mock response for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL with status code 201
2023-08-07 14:27:36 13:27:36 WARN i.g.i.s.ResponseServiceImpl - Response file and data are blank for [86cdf404-6284-4a9a-8ab8-0dc1ddeb647c] POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.p.o.s.ExampleServiceImpl - Using inline response
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.p.o.s.ExampleServiceImpl - Checking for mock example in specification (2 candidates) for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL
2023-08-07 14:27:36 13:27:36 DEBUG i.g.i.p.o.s.ExampleServiceImpl - No exact match found for accepted content types - choosing first item found (application/json) from specification. You can switch off this behaviour by setting configuration option 'pickFirstIfNoneMatch: false'
2023-08-07 14:27:36 13:27:36 TRACE i.g.i.p.o.s.ResponseTransmissionServiceImpl - Serving mock example for POST http://localhost:8090/api/deposits:search?detailsLevel=FULL with status code 201: [
2023-08-07 14:27:36 {
2023-08-07 14:27:36 "encodedKey":"5b853e007ba05e8a017acac995d34029",
2023-08-07 14:27:36 "id":"string",
2023-08-07 14:27:36 "name":"string",
2023-08-07 14:27:36 "notes":"string",
2023-08-07 14:27:36 "balances":{
2023-08-07 14:27:36 "totalBalance":0,
2023-08-07 14:27:36 "lockedBalance":0,
2023-08-07 14:27:36 "holdBalance":0,
2023-08-07 14:27:36 "blockedBalance":0,
2023-08-07 14:27:36 "availableBalance":0
2023-08-07 14:27:36 },
2023-08-07 14:27:36 "accountType":"string",
2023-08-07 14:27:36 "creationDate":"2016-09-06T13:37:50+03:00",
2023-08-07 14:27:36 "approvedDate":"2016-09-06T13:37:50+03:00",
2023-08-07 14:27:36 "accountHolderKey":"string",
2023-08-07 14:27:36 "productTypeKey":"string",
2023-08-07 14:27:36 "activationDate":"2016-09-06T13:37:50+03:00",
2023-08-07 14:27:36 "currencyCode":"string",
2023-08-07 14:27:36 "accountHolderType":"string",
2023-08-07 14:27:36 "accountState":"string",
2023-08-07 14:27:36 "_Deposit_Details_Deposit_Account":{
2023-08-07 14:27:36 "BELONGS_TO_ACCOUNT":"string",
2023-08-07 14:27:36 "ACCOUNT_MOBILE_NUMBER":"string",
2023-08-07 14:27:36 "ACCOUNT_EMAIL_ADDRESS":"string",
2023-08-07 14:27:36 "ACCOUNT_PROFILE":"string",
2023-08-07 14:27:36 "ACCOUNT_DISTRIBUTOR":"string",
2023-08-07 14:27:36 "ACCOUNT_NOTIFICATION_OPERATION":"string",
2023-08-07 14:27:36 "ACCOUNT_STATIC_PASSWORD":"string",
2023-08-07 14:27:36 "ACCOUNT_PROGRAM_UUID":"string",
2023-08-07 14:27:36 "ACCOUNT_PROGRAM_NAME":"string",
2023-08-07 14:27:36 "ACCOUNT_DISTRIBUTOR_UUID":"string",
2023-08-07 14:27:36 "ACCOUNT_DISTRIBUTOR_NAME":"string",
2023-08-07 14:27:36 "ACCOUNT_COMPANY_ID":"string",
2023-08-07 14:27:36 "ACCOUNT_PERSON_NAME":"string",
2023-08-07 14:27:36 "ACCOUNT_PERSON_LAST_NAME":"string",
2023-08-07 14:27:36 "ACCOUNT_LINKED_REAL_PERSON":"string"
2023-08-07 14:27:36 },
2023-08-07 14:27:36 "_Card_Deposit_Accounts":[
2023-08-07 14:27:36 {
2023-08-07 14:27:36 "ACCOUNT_CARD_ID":"22578490",
2023-08-07 14:27:36 "ACCOUNT_CARD_TYPE":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_CREATION_DATE":"2016-09-01T13:37:50+03:00",
2023-08-07 14:27:36 "ACCOUNT_CARD_STATUS_ID":"string",
2023-08-07 14:27:36 "ACCOUNT_MPTS_CARD_ID":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_EXPIRY_DATE_YYMM":"2023-08-01",
2023-08-07 14:27:36 "ACCOUNT_CARD_IDENTIFICATION_CODE":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_PSN":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_IIN_ID":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_LAST_4_ID":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_PROCESSOR":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_ORDER_REF":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_FLOW_STATE":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_CONTACT_LESS":"string",
2023-08-07 14:27:36 "_index":"string",
2023-08-07 14:27:36 "ACCOUNT_CARD_EXPEDITION_FLAG":"string",
2023-08-07 14:27:36 "ONE_TIME_REFILL":false,
2023-08-07 14:27:36 "ACCOUNT_RECHARGED":false
2023-08-07 14:27:36 }
2023-08-07 14:27:36 ],
2023-08-07 14:27:36 "_Bank_Account_Detail_Deposit_Acc":{
2023-08-07 14:27:36 "BANK_ACCOUNT_NUMBER":"string",
2023-08-07 14:27:36 "BIC_CODE":"string",
2023-08-07 14:27:36 "BANK_ACCOUNT_NAME":"string",
2023-08-07 14:27:36 "IBAN_VERIFIED":"string"
2023-08-07 14:27:36 },
2023-08-07 14:27:36 "_Deposit_MptsInfo":{
2023-08-07 14:27:36 "DEPOSIT_ACCOUNT_ID":"string",
2023-08-07 14:27:36 "DEPOSIT_CLIENT_ID":"string"
2023-08-07 14:27:36 },
2023-08-07 14:27:36 "_Deposit_BomusInfo":{
2023-08-07 14:27:36 "DEPOSIT_BOMUS_ID":"string"
2023-08-07 14:27:36 }
2023-08-07 14:27:36 }
2023-08-07 14:27:36 ]

from imposter.

outofcoffee avatar outofcoffee commented on September 22, 2024

Thanks @medaoutir. Using your config from your first comment, the second example is returned:

$ curl --header "Content-Type: application/json" \
  --request POST \
  --data '{
    "filterCriteria": [
        {
            "field": "_Card_Deposit_Accounts.ACCOUNT_CARD_ID",
            "operator": "EQUALS",
            "value": "22578492",
            "secondValue": null,
            "values": null
        }
    ],
    "sortingCriteria": null }'  \
'http://localhost:8080/deposits:search?detailsLevel=FULL'

Note: I had to remove the extra { and } around the JSON payload.

Log:

13:46:42 DEBUG i.g.i.h.AbstractResourceMatcher - Matched resource config for POST http://localhost:8080/deposits:search?detailsLevel=FULL
13:46:42 DEBUG i.g.i.p.o.OpenApiPluginImpl - Setting content type [application/json] from specification for POST http://localhost:8080/deposits:search?detailsLevel=FULL
13:46:42 DEBUG i.g.i.p.o.s.ExampleServiceImpl - Exact example selected: accountExtendedCreatedWhenBlocking
13:46:42 INFO  i.g.i.p.o.s.ResponseTransmissionServiceImpl - Serving mock example for POST http://localhost:8080/deposits:search?detailsLevel=FULL with status code 201 (response body 2648 bytes)

What's the engine-output when you run imposter --version?

from imposter.

medaoutir avatar medaoutir commented on September 22, 2024

Hi @outofcoffee
{
"imposter-cli": "0.28.0",
"imposter-engine": "none"
}
when running:

docker exec -it ais-mock-server-mambu imposter --version

from imposter.

outofcoffee avatar outofcoffee commented on September 22, 2024

Thanks @medaoutir.

The logging suggests the following match behaviour for the accountExtendedCreatedWhenBlocking resource:

  • 🚫 path: not matching request
  • ✅ method: matches request
  • ✅ query params: matches request
  • ✅ headers: matches request
  • ✅ body: matches request

I'm not sure why the path isn't matching your request - the resource has the path /deposits:search whilst the HTTP request is /api/deposits:search 🤔 - have you set a basePath in the config by any chance?

from imposter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.