py2swagger icon indicating copy to clipboard operation
py2swagger copied to clipboard

Doesn't work with falcon

Open silver8ack opened this issue 7 years ago • 7 comments

This doesn't seem to work with falcon. It's missing most of my routes... only routes with a variable in them are showing up in the output.

silver8ack avatar Feb 21 '18 16:02 silver8ack

May I please ask how you're launching the process with py2swagger? (i.e which command depending on your environment)

mumrau avatar Mar 06 '18 13:03 mumrau

Here's my routes

app.add_route('/api/v1/healthcheck', HealthCheckResource())
app.add_route('/api/v1/resources', ResourceCollection())
app.add_route('/api/v1/resources/{id}', ResourceItem())
app.add_route('/api/v1/resources/{id}/children', ResourceChildren())

Run this: py2swagger -o swagger.json falcon main:app

And the output only has this under paths:

"paths": {
    "/api/v1/healthcheck": {
      "get": {}
    },
    "/api/v1/resources/{id}/children": {
      "get": {}
    }
  }

silver8ack avatar May 25 '18 16:05 silver8ack

Did someone get the solutions?

amitsharmaa8891 avatar Jun 18 '18 14:06 amitsharmaa8891

@amitsharmaa8891 I created a falcon plugin for apispec that generates swagger docs

https://github.com/alysivji/falcon-apispec

alysivji avatar Aug 10 '18 11:08 alysivji

@alysivji I just used your plugin for a new project and it’s working like a charm. Very nice. Your project deserves more attention.

silver8ack avatar Aug 10 '18 12:08 silver8ack

Very glad to hear it's useful for others! Cheers to the apispec devs for doing most of the heavy lifting!

alysivji avatar Aug 10 '18 12:08 alysivji

is it working with falcon v3 ?

julienlau avatar Sep 21 '21 16:09 julienlau