Comments (9)
Fixed in 3.11.0
// example usage
* @requestFormDataBody <User>.exclude(id).append("picture":{"type":"string","format":"binary"})
from adonis-autoswagger.
There is already a format decorator for the model field
export default class User extends BaseModel {
@column()
// @format(binary)
declare file: string
}
from adonis-autoswagger.
My model does not have a property for that
@column()
declare imageUrl: string
the endpoint request takes a "file" property, not imageUrl that is a file
from adonis-autoswagger.
based on your example, I'd assume your model has other properties too. i.e. name, email, etc... so you'd need to link that file to some property, wouldn't you?
in other words, how do you expect to handle the submitted formdata otherwise?
from adonis-autoswagger.
Yes, I have multiple properties
In my particular case, I take the file from the "file" property on the request, alongside other Model properties.
I upload the file and populate Model.imageUrl with the uploaded file's path, then save
from adonis-autoswagger.
Well, there you have your answer. then just add a "virtual" field file to your model... doesn't have to be mapped to a column.
from adonis-autoswagger.
yes, but then I would have to exclude it from everywhere I have the Model referenced, right?
from adonis-autoswagger.
yes! 😅
out of curiosity, did you try the append() notation? does it work on formdata?
from adonis-autoswagger.
append() does not work and neither does exclude()
it just displays the whole model inside
from adonis-autoswagger.
Related Issues (20)
- Bug: Problem when using the "Date" type HOT 2
- No such file or directory
- No such file or directory HOT 4
- Bug: Docs From Controllers Don't work when using inject() HOT 5
- Bug: Same Prefixed Method's Docs Conflict HOT 2
- Feat: Nesting Model Ref on Response HOT 10
- Feat: Cofigurable Interface Location HOT 2
- Document via decorators?
- No such file or directory HOT 4
- Scalar API Client Proxy Error HOT 5
- Feature Request: Add configure script HOT 2
- appPath: Not correct on controllers HOT 3
- Feature request: manual tag HOT 1
- Token header with other type not Bearer HOT 4
- Production bug: trying to load different file HOT 1
- /swagger-yaml throws internal server error when running with build files HOT 4
- Question: How to Omit controller methods from the docs which doesn't exists HOT 1
- Documentation description? HOT 1
- Nested or extend interface not working with @responseBody HOT 16
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 adonis-autoswagger.