https://linen.dev logo
#wiremock-java
Title
# wiremock-java
k

Kaustav Surai

09/24/2023, 3:44 PM
Hi, I’m facing an issue-I’m having mocks(mappings n response files), some responses contain HTML double curly braces in response json. But when spinning up UI, it is converting that element with empty string so unable to replace the relevant value from UI code. Can anyone know how to resolve it please? Thanks.
t

Tom

09/25/2023, 9:45 AM
Can you share a bit more detail @Kaustav Surai? It sounds like you’re using templating, but I couldn’t be sure from your description - can you give the details of the config you’re starting WireMock with and the input + expected/actual output you’re getting?
k

Kaustav Surai

09/25/2023, 11:31 AM
Hi @Tom, Thanks for your message. Sending sample response
Copy code
{
  "uiElements": [
    {
      "type": "PLAIN_TEXT",
      "text": "Hello"
    },
    {
      "type": "HTML",
      "html": "<a class=\"link\" href={{DOWNLOAD_LINK}}> Download</a>"
    }
  ]
}
I am expecting {{DOWNLOAD_LINK}} to be replaced from the ui code but getting empty href however it is working fine from actual service.
Config is here
Copy code
version: '3.9'
networks:
  test:
services: 
  mock-server:
    build:
      dockerfile: Dockerfile
      context: .
    expose:
      - 8080
    ports:
      - "8080:8080"
    command:
      - -verbose
      - -global-response-templating
    networks: 
      test:
2 Views