Comments (8)
I don't see any way for a workaround without implementing the above mapping. If we mapped the validators in a similar fashion to how the fields are mapped from marshmallow to restx, then the docs should work. It will require a bit of dev work which I can't provide right now - but would be a great contribution opportunity.
from flask_accepts.
As a side thought one of the reasons this is so frustrating is the limitation that you cannot modify the fields generated by the for_swagger method if they come from a marshmallow schema. Obviously this is the main feature of the whole library so I can understand why it isn't a feature yet. However if there was a way to override or extend fields from the schema using the dict() parameters you would preserve the convenience of marshmallow schema's for the common case while allowing for slight modifications when you need to make a single field change. Just a thought.
from flask_accepts.
There is also some semi-relevant discussion in #16
from flask_accepts.
I am completely open to enabling this functionality. It was deprioritized previously due to being an outsized amount of work versus a smallish unlock, but if a increasing number of users have need for this then that priority goes up.
My bandwidth is nonexistent as of late, but if you’d like to take a stab I’m happy to comment/mentor/discuss through it.
from flask_accepts.
My point of using swagger is that for internal/private app, I don't need to write docs alongside the app.
My web app had many fields with validate.OneOf()
schema. They didn't show up in swagger. So the end-user can't know what are available options.
+1
from flask_accepts.
+1 for this feature
from flask_accepts.
Are there any workarounds for this to work?
from flask_accepts.
+1 for this feature
from flask_accepts.
Related Issues (20)
- When using the @responds decorator, X-Fields headers are automatically applied to the swagger request HOT 2
- Swagger fails to load when a schema does not have a default set in one of the fields. HOT 4
- Marshmallow schema for form data HOT 1
- Query parameter and header schemas do not respect the data key attribute HOT 1
- Passing a schema type to the `schema` argument of @accepts ignores the type's Meta attributes
- Marshmallow 4 breaking changes
- Overriding flask_restx field
- Nested Marshmallow Schemas throwing error on Swagger HOT 5
- Partial param for Schema loading HOT 4
- [Q] Customize schema_errors? HOT 2
- Only swagger generation for end-point HOT 10
- What is the best practice for file uploads? HOT 2
- Working with UUIDs, Marshmallow & 'missing' fields
- Nested schemas with many=true do not generate a list of schemas in the swagger docs HOT 6
- The new partial keyword of accepts() breaks the marshmallow schema
- Using multiple different schemas in accepts decorator raises KeyError if there is a ValidationError
- Cookie header validation works on gunicorn, does not on NGINX
- Static typing on request.parsed_obj
- More forgiving loading of the JSON schema payload ignoring the mimetype
- Skip response fields where value is None
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_accepts.