openkfw / TruBudget

A blockchain-based workflow tool for efficient and transparent project management
https://openkfw.github.io/trubudget-website/
GNU General Public License v3.0
84 stars 39 forks source link

api: combining fastify schemas with joi validation SP 5 #1064

Closed Stezido closed 5 months ago

Stezido commented 2 years ago

Discussed in https://github.com/openkfw/TruBudget/discussions/970

Originally posted by **laurenzhonauer** September 2, 2021 In the fastify documentation it is mentioned that validation libraries like joi can be "included" in the schema definition. Currently we are doing both seperatly, by combining the joi config into the schema definition the api code could be reduced and become more readable and maintainable. https://www.fastify.io/docs/latest/Reference/Validation-and-Serialization/#using-other-validation-libraries
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity for 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because of inactivity. You can re-open it if needed.

Stezido commented 2 years ago

TODOs:

egdmrsy commented 10 months ago

Fastify solution works but not compatible with swagger. The transform property (Schema transform for swagger) needs to be defined when registering the Fastify Swagger plugin on the server. Two problems:

galethil commented 5 months ago

Closed due to complexity