Closed tobdru closed 11 months ago
I now had a deeper look into it, and I think a solution could be:
My plan is to do a pr in the next days so I would be very interested in your opinion @psugihara before putting to much effort into it.
Hey @tobdru, interesting idea. Thanks for tagging me, I missed the earlier issue.
That sounds like a nice way of getting a more typesafe contract and I'll be happy to review and merge.
After investigating a few more hours, I sadly could not find an easy solution. We were not able find a package to automatically resolve TS types to swagger definition. Therefore I close this Issue.
ok, thanks for taking a look @tobdru
We had some issues at the contract between the mail service and our backend. So to integrate the mailing endpoint seamless I had the idea to generate an openapi.json / swagger.json.
This should then contain the different mails as different options for the sendMail & generateMail endpoints.
e.g.:
We could then easily autogenerate clients and reduce contract issues.
To solve it I have the idea to generate the general open api spec via: https://www.npmjs.com/package/next-swagger-doc And then manually add the content options.
What do you think about it?
If you have any other idea, I would love to hear it.