Comments (7)
Hi @sebaxq thanks for the issue (and very thanks for the proposed solution 😄)
However, I think I'm missing something.
In the example there are cases where not all {put,get,post,delete} are defined, yet it doesn't crash.
Could you provide a repro?
from flask-restful-swagger.
Hi @rantav I am creating an architecture and I am using inheritance to build services, here is on swagger breaks. I attached a picture of a small example.
from flask-restful-swagger.
Hi @sebaxq at first I thought it was b/c of inheritance and the fact that in the base class all four methods are defined but not all of them are defined in the concrete class.
So I created a test case here fd75de0
But this test passes. So I am still confused....
Would you be able to run this new test case I created and report?
cheer.
from flask-restful-swagger.
Hello, I run the test case and it crashes. I attached a picture with the error.
Here the module package info:
Metadata-Version: 1.0
Name: flask-restful-swagger
Version: 0.11
Summary: Extrarct swagger specs from your flast-restful project
Home-page: https://github.com/rantav/flask-restful-swagger
Author: Ran Tavory
Author-email: UNKNOWN
License: MIT
Description: Please see documentation here: https://github.com/rantav/flask-restful-swagger
Platform: UNKNOWN
from flask-restful-swagger.
Looks like a matter of versioning, maybe python version of a package version.
What does pip freeze
tell you?
pip freeze
Flask==0.10.1
Flask-RESTful==0.2.8
Jinja2==2.7.1
MarkupSafe==0.18
SQLAlchemy==0.8.4
Werkzeug==0.9.4
distribute==0.6.35
itsdangerous==0.23
six==1.4.1
stevedore==0.8
virtualenvwrapper==3.7
wsgiref==0.1.2
And python --version
:
python --version
Python 2.7.2
from flask-restful-swagger.
Sorry for the delay, here are my versions:
pip freeze
Flask==0.10
Flask-RESTful==0.2.12
Jinja2==2.7.3
MarkupSafe==0.19
SQLAlchemy==0.9.0
Werkzeug==0.9.4
distribute==0.7.3
itsdangerous==0.24
six==1.6.1
wsgiref==0.1.2
python --version
Python 2.7.5
My coworkers have the same error and we use my solution temporary.
from flask-restful-swagger.
Hi @sebaxq I'm sorry for the delay but I just can't repro your error.
I have installed the same python version as you have and all the dependencies at exactly the same version that you have but still no bug 😬
$ pip freeze
Flask==0.10
Flask-RESTful==0.2.12
Jinja2==2.7.3
MarkupSafe==0.19
SQLAlchemy==0.9.0
Werkzeug==0.9.4
aniso8601==0.82
distribute==0.6.35
itsdangerous==0.24
pytz==2014.4
six==1.6.1
stevedore==0.8
virtualenvwrapper==3.7
wsgiref==0.1.2
$ python --version
Python 2.7.5
and yet:
$ PYTHONPATH=. python examples/inheritance.py
* Running on http://127.0.0.1:5000/
* Restarting with reloader
# All OK
I'm at loss.
Also, your solution isn't clear to me. resource.dict
doesn't exist, only __dict__
does.
from flask-restful-swagger.
Related Issues (20)
- ExtDeprecationWarning: Importing flask.ext.restful is deprecated, use flask_restful instead HOT 4
- AssertionError: View function mapping is overwriting an existing endpoint function: users./v1/users/help HOT 1
- Get param invalid HOT 1
- Error Status Codes in UI HOT 3
- Is there a way to provide a custom shema for ResponseClass? HOT 1
- Pip install the package. It couldn't support flask v1.0 HOT 9
- Make resource fields mandatory HOT 1
- Manually returning spec endpoint
- Can't work with python3.7? HOT 1
- pass basePath to swagger not work HOT 2
- can't find /api/spec.json when i add url_prefix in blueprint HOT 1
- Python3.6.5 中可以产生JSON但是HTML页面无法正常显示?
- How to describe the return result?
- How to define Parameters while giving request get
- [Question] How can I set an example value? HOT 2
- Method post and url parameter
- Warnings in Python 3.8
- Specify all imports in examples HOT 1
- Describe @swagger.operation parameters properly in documentation HOT 1
- API prefix does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-restful-swagger.