Skip to content

How to use template in response for number type? #1050

Closed Answered by lbroudoux
akadnikov asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!
For using the number type, you have to serialize your example differently to avoid Microcks interpreting it as a String.
Typically, IIRC, you have to use the serialized JSON form embedded in YAML. Something like:

examples:
  MOCK_0:
    value: |-
      {"name": "Eclair Cafe", "description": "Delicieux Eclair au Cafe pas calorique du tout", "size": "M", "price": {{request.body/price}}, "status": "available"}

that way, the example is considered as a String and not as JSON with type interpolation.

Let me know if those memories are correct.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@akadnikov
Comment options

Answer selected by lbroudoux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants