.NET & C# · Web API
How would you answer an interview scenario involving OpenAPI and API documentation in Web API?
I would use OpenAPI as the machine-readable API contract and document endpoints, request and response schemas, parameters, authentication schemes, status codes, validation errors, and examples. In ASP.NET Core I would generate the specification from the application and expose interactive documentation for consumers. I would validate the contract in CI, compare it with the previous version to detect unintended breaking changes, and keep error responses and security definitions accurate so generated clients and external teams can rely on the documentation.