Thursday, 15 November 2018

Checking for community interest. Small survey.

In some of my projects at my company, clients have been asking for us to provide swagger specs of our APIs so I created a library to generate the swagger spec from json schemas that I was already using to validate request parameters.I know there are some other libraries that do similar stuff but, as far as im concerned, they eitherrequire you to write most of the spec yourselfcreate the api from the spec and not the other way around (which is what I wanted)​(it was made for express btw)How its working right now is that you need to create a schema for a route before creating the route, otherwise it throws an error and it validates request parameters through the schema as well as generate a 3.0 openAPI spec from those schemas. It also has some "strictness" levels to decide wether to enforce or not to add things like descriptions in parameters aside from type or some other metadata that for super basic docs wouldnt really be needed or maybe you are just too lazy to write but still want the parameter validation and docs.Everything else in express remains the same so nothing changed in route mapping itself, etc and the validation is a regular json schema so you should be able to validate just about any kind of parameter you haveAs it is right now it works fine for my job's needs so Ill probably keep it as is, but as I couldnt really find a module like what I described that I actually liked, I was wondering if people were interested in this as to dedicate some of my spare time to add some more features like:​making it compatible with other API specifications or documentation toolsensuring it works for some edge cases that I didnt really consider in the doc generation as it doesnt really happen in our APIsmaybe more configuration on what information is required in the schema before it stops throwing errors​Anyway, STRAWPOLL!

Submitted November 15, 2018 at 11:24PM by igna92ts

No comments:

Post a Comment