7

What is the most convenient and comprehensive way of validating incoming requests in Falcon views against Swagger 2.0 specification written in json?

I used to do the same for Pyramid apps with great tool called pyramid_swagger. It was seamlessly pluggable on application level and it attached validated dict to the request object. It contained everything, including path parameters, querystring parameters and of course body params.

I tried Flex and falcon-json-io, but couldn't make it do what I need. Also serve_swagger is completely different story, I don't need an autogenerated API.

At this point I am considering writing my own tool or extending Flex or falcon-json-io. Is there something I missed?

Rajan
  • 1,463
  • 12
  • 26
gwaramadze
  • 4,523
  • 5
  • 30
  • 42
  • Hi, how do you generate swagger documentation for your api written in falcon? – Ayushi Dalmia Aug 19 '16 at 07:09
  • 2
    @AyushiDalmia I don't. I write it myself with consultation with the end user of future API. In my case I do it together with our front-end developers. To _generate_ Swagger docs would mean that it's generated from something. What would that be? A whiteboard after product meeting? :) My point is that you need to document API **before** implementing it. At least that's my opinion. – gwaramadze Aug 19 '16 at 09:52
  • Gotcha! I used http://editor.swagger.io/#/ and generated my json file. However, I am not able to integrate well with the index.html in the dist folder of the Swagger-UI repo. Any pointers on how to add the json? Through url or spec? – Ayushi Dalmia Aug 19 '16 at 10:56
  • 1
    I don't use Swagger UI yet. You should search for answers or post a new question if you cannot find anything appropriate. – gwaramadze Aug 19 '16 at 11:14
  • 2
    In case anyone is looking for an answer, I have put together a small lib that does it: https://github.com/gwaramadze/falguard – gwaramadze Mar 01 '18 at 22:20
  • @gwaramadze Your library should be an answer. – Alister Lee Jan 07 '19 at 02:25
  • 1
    @AlisterLee hey thanks! It actually was, but local "bureaucracy" got it deleted... – gwaramadze Jan 07 '19 at 13:27

0 Answers0