web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue with misleading ...
Power Automate
Suggested Answer

Issue with misleading error messages when MS-Dynamics-Values in swagger return an error

(0) ShareShare
ReportReport
Posted on by
 
I am having a (recent) issue with  flows, especially after copying them and ending up with an invalid connection.
 
We are authenticating users via an API Key.
The API key is tied to an oauth connection to a dynamics 365 instance saved in another System.
 
There are a lot of MS-Dynamic-Values in swagger pulling in data for both the designer and the actual flow from that external d365 connection. 
 
When copying a flow, the old api key is sometimes accidently reused and the connection therefore becomes invalid.
 
As a result, the designer obviously doesnt resolve the MS-Dynamics-Values anymor. Running the flow then is ending up with a rather weird error message hiding the actual reason:
 
ResponseSwaggerSchemaValidationFailure
The API 'api' returned an invalid response for workflow operation 'Who_am_I' of type 'OpenApiConnection'. Error details: 'The API operation 'WhoAmI' requires the property 'body/type' to be of type 'Object' but is of type 'String'.'
 
 
Checking insights, it seems as if the flow executes each and every MS-Dynamics-Values in the swagger file (Its definetly more than what our whoami step requires), receives a 401 on those calls, with Invalid API Key message, but then decides to swallow the whole error messages and display the above generic one, which is pretty annoying. 
 
Is there any event, one could attach to on the ResponseSwaggerSchemaValidation, that would allow to return a proper error message or any way of getting an actual message out to the user when the Api key is invalid?
 
 
Bypassing authentication and handing back empty response objects for the method called in MS-Dynamics-Values does allow the flow to run and then return the actual 401 of the Request, but thats a pretty nasty band aid I definetly do not want to apply, if it can be helped.  
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    sannavajjala87 Profile Picture
    931 Super User 2026 Season 2 on at
    Hi,
     
    This looks like a custom connector dynamic values + invalid connection handling issue rather than a problem with the actual WhoAmI action.
    When a copied flow reuses an old or invalid API key, Power Automate may try to resolve the connector’s dynamic values at design/runtime, get 401 responses, and then surface a misleading ResponseSwaggerSchemaValidationFailure instead of the real authentication error.

    I don’t think there is an event you can hook into specifically for ResponseSwaggerSchemaValidationFailure to replace the platform-generated message. A better approach would be to make the dynamic value operations return a valid structured error object when authentication fails, rather than a plain string. The error you’re seeing suggests the connector expected an object response but received a string.
     
    A few things I’d try:
    • Ensure all dynamic value endpoints return the schema defined in Swagger, even on 401/error cases.
    • Add a lightweight “Validate connection/API key” operation and call it early in the flow.
    • Avoid returning raw text error messages from dynamic value operations.
    • After copying flows, force users to recreate or reselect the connection reference.
    • Consider using connection references/ALM patterns to avoid accidental reuse of stale API keys.
    The misleading error is frustrating, but the root cause appears to be the invalid API key combined with dynamic value resolution failing before the actual action error is surfaced.
     
    Thanks & Regards,
    Manoj Annavajjala

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 269 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 184 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard