0
votes

I am creating an API with Mule Anypoint Design center, where I receive data with type text/plain from other endpoints. Can I just use text/plain in below raml code instead of application/json?

Why am I asking this?

My endpoint is AWS SNS and it sends, a HTTP header, Content-Type, with value "text/plain" only and the apikit router in studio validates whether the content-type is "whatever specified in RAML spec(application/json)". Ofcourse I can disable validations, but I have other things to validate which depends on it.

responses: 
  201:
    body: 
      application/json:
        example:  {"msg" : "Flight inserted successfully"}
1

1 Answers

0
votes

Yes you can change it to text/plain in RAML if needed. But if you want your response to be json, you'd be better off transforming your payload and overwriting the Content-type header in Mule/Anypoint design center.