Forum Discussion

Alexey_test's avatar
Alexey_test
New Contributor
7 years ago

How to use a project property in mock service resource path

Hello

 

How to use a project property in mock service resource path?

 

I have a project property accountNumber  and it works well in requests, but doesnt work in resource path of mock service. Can please sone one explain to me how to use it in resource path

/api/v1/account/${#Project#accountNumber}/corporate_card_sign
  • This is quite strange. So the property is available in the Mock Service itself when accessed in a OnRequest/AfterRequest script but it can't be referenced from the resource path. I tried both referencing it normally (like ${#Project#property}) and also with property expansion ( ${=context.expand('${#Project#context}')} ). 

     

    I honestly think this is a bug/ missing feature.

  • Lucian's avatar
    Lucian
    Community Hero
    Hey,

    Are you using readyapi? where is your mock service defined?
    • Alexey_test's avatar
      Alexey_test
      New Contributor

      I careated mock service in soap ui based on rest api generated from swagger, i have a project property wich i linked in request and its works fine, but when i try to put a link on that prorerty in mock request resource path it dontresponserequest

    • Alexey_test's avatar
      Alexey_test
      New Contributor

      I know how to use property-expansions in the request path but how to do it in a response pat

      • Lucian's avatar
        Lucian
        Community Hero

        ah I see. Let me check. I would have expected the properties to work the same...