Open API 2.0 schema used as Invocable Apex with Flow that has been working for six months. Two days ago we started getting an error on the 200 response.
Expected declared response media type application/json, but got text/plain; charset=UTF-8 for operation get
We have a Case opened since we didn't touch the schema and barring a change by the other party (Federal Govt), then must've been a change at Salesforce but I'm hoping someone has a suggestion for how we might edit our schema now to overcome this error.
The responses which look like this in Postman used to be recognized as JSON. This is valid JSON and will format correctly if I put into an editor. (The below is public info)
{"resultCount":1,"results":[{"created_epoch":"1135112244000","enumeration_type":"NPI-2","last_updated_epoch":"1223408717000","number":"1588640692","addresses":[{"country_code":"US","country_name":"United States","address_purpose":"MAILING","address_type":"DOM","address_1":"1364 CLIFTON RD NE","address_2":"ROOM HB48","city":"ATLANTA","state":"GA","postal_code":"303221064","telephone_number":"404-686-7041","fax_number":"404-712-5731"},{"country_code":"US","country_name":"United States","address_purpose":"LOCATION","address_type":"DOM","address_1":"1364 CLIFTON RD NE","city":"ATLANTA","state":"GA","postal_code":"303221064","telephone_number":"404-686-7041","fax_number":"404-712-5731"}],"practiceLocations":[],"basic":{"organization_name":"EMORY UNIVERSITY","organizational_subpart":"NO","enumeration_date":"2005-12-20","last_updated":"2008-10-07","status":"A","authorized_official_first_name":"Jimmy","authorized_official_last_name":"Hatcher","authorized_official_middle_name":"T","authorized_official_telephone_number":"4046862983","authorized_official_title_or_position":"CFO Emory Healthcare","authorized_official_name_prefix":"Mr."},"taxonomies":[{"code":"282N00000X","desc":"General Acute Care Hospital","state":"GA","license":"044-049","primary":true}],"identifiers":[{"code":"05","desc":"MEDICAID","issuer":null,"identifier":"00000712A","state":"GA"},{"code":"06","desc":"MEDICARE OSCAR/Certification","issuer":null,"identifier":"110010","state":"GA"}],"endpoints":[],"other_names":[]}]}
The relevant path statement is:
"paths": {
"/": {
"get": {
"description": "Get NPPES NPI data",
"consumes": ["application/x-www-form-urlencoded"],
"produces": ["application/json"],
produces
line totext/plain
, assign it to an in/out flow variable, then pass it to Apex for deserialization.text/plain;charset=UTF-8