[Feature] Make the API public and document it
I wanted to integrate this awesome tool in end-to-end testing using docker and there I would love to have an API, A openapi spec would be awesome! Currently the routes and types must be manually derived by inspecting the source code, which is cumbersome :/
Often a openapi generator can easily be integrated 🚀
I was in the exact same situation and found this: https://github.com/gessnerfl/fake-smtp-server which is actually maintained to date and has an interface and swagger API documentation.
I am open to this in future, but have resisted making the API public until now because I wanted to be able to change it freely without having to think about versioning.
Instead of hosting a complete application like SMTP4DEV, you might consider using an SMTP server component directly in your automated tests. SMTP4DEV uses Rnwood.SmtpServer and if you use .NET you can use this:
Example here: https://github.com/rnwood/smtpserver/blob/master/Rnwood.SmtpServer.Tests/ClientTests.cs
This should be much simpler and more robust than starting up an app in separate process. Similar libraries exist in other ecosystems if you're not on .NET.
@rnwood It's just more convenient when writing the tests locally rather within actual test suite, we're testing email contents not the functionality of an smtp itself so it would just be easier to use the same smtp4dev docker service that is used in development for testing using the API, it's language/backend agnostic solution. It's both easier since we can see the emails being sent during tests so that we can inspect them etc.. & we can screenshot the email contents in an end to end test.
And I think the project is mature enough now for an API documentation, if for any reason you'd be changing things drastically it would be a major version change.
Would appreciate this small change since there are some useful features here I'm missing in the other project I mentioned above like the unread indicator and socket connection.
Work has begun on this in #1376
This is merged and available. To get started, click ... button in the header and then "API".