You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a C# project using two response types sharing the same name but are in different namespaces, namespace1.A and namespace2.A
I have one endpoint that returns namespace1.A and one endpoint that returns namespace2.A
Each endpoint has its own unique path and OperationId
Swagger fails to load with error message:
"Failed to load API definition. Fetch error response status is 500 /swagger/v1/swagger.json"
Through troubleshooting I observe that swagger requires the return type to be uniquely identifiable.
So if I rename one of the return types, for example, if I rename namespace2.A to namespace2.B, then swagger can detect things correctly.
There has to be a better alternative to this.
Is SwaggerDiscriminator supposed to resolve this? Because applying that on the response types did not seem to help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a C# project using two response types sharing the same name but are in different namespaces, namespace1.A and namespace2.A
I have one endpoint that returns namespace1.A and one endpoint that returns namespace2.A
Each endpoint has its own unique path and OperationId
Swagger fails to load with error message:
"Failed to load API definition. Fetch error response status is 500 /swagger/v1/swagger.json"
Through troubleshooting I observe that swagger requires the return type to be uniquely identifiable.
So if I rename one of the return types, for example, if I rename namespace2.A to namespace2.B, then swagger can detect things correctly.
There has to be a better alternative to this.
Is SwaggerDiscriminator supposed to resolve this? Because applying that on the response types did not seem to help.
Beta Was this translation helpful? Give feedback.
All reactions