Dont know if it is the best solution, but if you know the keys of the JSON, you can use the Processor 'EvaluateJsonPath' and put the values as attribute to the flowfile.
Then use Processor 'AttributsToJson' and set the JSON key and the value with expression language ${attr:trim()}