Dominic-DallOsto / zotero-api-endpoint

Provides an HTTP server endpoint for interacting with Zotero
22 stars 4 forks source link

Add dynamic type validation of post data #2

Closed Dominic-DallOsto closed 2 years ago

Dominic-DallOsto commented 2 years ago

As explained here - would be nice to set this up with AJV and TypeScript JSON Validator.

cboulanger commented 2 years ago

Funny, I had the exact same idea!

cboulanger commented 2 years ago

My PR makes this easier because it separates the request-response stuff from the actual methods which take typeable input and output without worrying about marshaling the data.

I am working with https://www.postman.com/ to run tests against the endpoints. Probably we should set up a group with data fixtures to run tests against. I think Postman lets you develop these tests visually and the export a node/Chai version of it for automated testing. Could make sense if this catches on.

github-actions[bot] commented 2 years ago

:robot: this is your friendly neighborhood build bot announcing test build 0.0.1.34 ("Schema validation of API requests (#9)\n\nFixes #2")

Install in Zotero by downloading test build 0.0.1.34, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".