© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
13 replies
ægteemil

✅ Describing `object` response in swagger

Hey. I have an endpoint that returns an object that looks something like this.
public record Webhook(
    string Id,
    PayloadType Type,
    object Payload
);
public record Webhook(
    string Id,
    PayloadType Type,
    object Payload
);

where
Payload
Payload
can change depending on the enum value. In typescript or other languages, I'd represent this object as a union type, but since we don't have that in C#, I'd just like to describe the possibilities of this in my swagger documentation
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

swagger Error: response status is 401
C#CC# / help
2y ago
Stack overflow in swagger
C#CC# / help
3y ago
Swagger + Database problem
C#CC# / help
2y ago
Swagger, openAPI specification
C#CC# / help
3y ago