Skip to content

Conversation

jmini
Copy link

@jmini jmini commented Jul 30, 2025

The serialization of a StringBodyDTO looks like this:

{
      "type" : "STRING",
      "string" : "{\"id\":37,\"username\":\"john.doe\"}",
      "rawBytes" : "eyJpZCI6MzcsInVzZXJuYW1lIjoiam9obi5kb2UifQ==",
      "contentType" : "application/json"
}

To be consistent with the StringBody implementation:

@JsonIgnore
public byte[] getRawBytes()
{
return this.rawBytes;
}

I think it would make sense to ignore the rawBytes attribute in the StringBodyDTO, to have it like this:

{
      "type" : "STRING",
      "string" : "{\"id\":37,\"username\":\"john.doe\"}",
      "contentType" : "application/json"
}

Ignore rawBytes in StringBodyDTO
@AB-xdev
Copy link
Member

AB-xdev commented Aug 25, 2025

Thank you for the PR.

However I don't quite get the problem or why this is fixed with a @JsonIgnore as there is a custom https://github.com/xdev-software/mockserver-neolight/blob/c8a7cbf0786969788064d32864d2035de8385e3c/core/src/main/java/software/xdev/mockserver/serialization/serializers/body/StringBodyDTOSerializer.java in use...

Could you create an issue that explains this in detail and link it to the PR (using fixes #<IssueId>)?

@AB-xdev AB-xdev added the waiting-for-response If no response is received after a certain time the issue will be closed automatically label Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-response If no response is received after a certain time the issue will be closed automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants