Skip to content

CreateTestResult builds JSON payload manually causing invalid escaping #377

@Manar-Elhabbal7

Description

@Manar-Elhabbal7

Describe the bug

CreateTestResult() in microcks_client.go manually builds JSON request payloads using string concatenation instead of json.Marshal().

This becomes fragile when values contain special characters such as quotes ("), backslashes, or newlines.

Example:

my "special" api:1.0

Solution

Replace manual JSON string construction with typed request structs and json.Marshal().

This ensures proper escaping and safer request generation.

Expected behavior

{"serviceId":"my \"special\" api:1.0"}

Actual behavior

{"serviceId": "my "special" api:1.0"}

How to Reproduce?

No response

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions