Comments (5)
I'll put instructions here later today.
Also, you may reach me in the oatpp devs chat on Gitter - https://gitter.im/oatpp-framework/Lobby (user oatpp_io_twitter)
In any case it should be two pretty simple PRs to oatpp
and to oatpp-swagger
from oatpp-swagger.
How To Add New Info Property To DTO_FIELD_INFO:
In oatpp
Add new property to Property::Info
- https://github.com/oatpp/oatpp/blob/master/src/oatpp/core/data/mapping/type/Type.hpp#L282
In oatpp-swagger
Document the new property here - https://github.com/oatpp/oatpp-swagger/blob/master/src/oatpp-swagger/oas3/Generator.cpp#L102
You may also need to extend the schema object.
Please let me know if you have any questions.
from oatpp-swagger.
Hello @natanael ,
Thanks for opening the issue!
The default values feature is currently not supported in Oat++.
However, it's pretty easy to add this functionality in the form of:
DTO_FIELD_INFO(name) {
info->description = "user first name"; //<-- Fields description is integrated with Swagger-UI.
info->default = "Ivan"; //<-- explicit declaration of default value.
}
DTO_FIELD(String, name, "yourName") = "Ivan"; //<-- unfortunately we can't track default value from this place.
So, I would propose whether to wait while we add this functionality (I'll. schedule it for the next nearest release 1.2.0
)
or you may contribute and add it by yourself (I'll provide the assistance).
Best Regards,
Leonid
from oatpp-swagger.
Thanks for the quick reply!
I would love to contribute, but I'm prevented from doing it during business hours by contract, will try later today. Other than a simple PR is there anything I should keep in mind?
from oatpp-swagger.
Thanks so much for pointing me on the right direction! The PRs are:
oatpp/oatpp#276
#24
I named it default_value
and implemented it as a string but one ideally would want it to match the field, maybe we can do that in a following issue.
from oatpp-swagger.
Related Issues (20)
- No mapping for HTTP-method HOT 3
- CMake compiling with oatapp linking issues HOT 1
- Header parameters not shown in Swagger UI HOT 2
- missing cpack for module HOT 2
- Content-Type not set for CSS or JS responses HOT 2
- Error on start
- oatpp-swagger with HTTPS
- swagger-ui authorize bug
- To use "application/x-www-form-urlencoded" with readBodyDtoAsync HOT 1
- Set hosting base path
- Adding a Response with No Message Body Leads to an Oat++ Assertion Error at Runtime
- How To Describe File Type for `multipart/form-data` HOT 1
- The contact information cannot be an email. HOT 1
- bad interpretation of enum schemas
- Add authorization on the swagger controller
- Windows Support
- Crashed when added doc controller
- Access to raw OpenAPI JSON
- Problem with cmake FetchContent_* both oatpp-swagger and oatpp
- Support for schemas which better reflect DTO polymorphic fields
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 oatpp-swagger.